home / skills / openclaw / skills / solana-copy-trader

solana-copy-trader skill

/skills/youthaiagent/solana-copy-trader

This skill helps you monitor Solana whale activity and copy trades in real time with safe paper trading and live alerts.

npx playbooks add skill openclaw/skills --skill solana-copy-trader

Review the files below or copy the command above to add this skill to your agents.

Files (15)
SKILL.md
3.2 KB
---
name: solana-copy-trader
description: >
  Solana whale copy trading bot. Track any wallet, copy trades in real-time via Jupiter + Pump.fun APIs,
  with paper trading simulation and live execution. Use when user wants to copy trade a Solana wallet,
  track whale transactions, scan for arbitrage opportunities, monitor pump.fun token launches,
  or set up an autonomous Solana trading bot.
---

# Solana Copy Trader

Real-time Solana whale copy trader using Helius WebSocket + Jupiter API + Pump.fun.

## Quick Start

```bash
cd solana-bot
npm install
cp .env.example .env  # fill in keys
node index.js copy    # paper mode (safe)
node index.js watch   # whale tracker only
node index.js scan    # arb scanner
```

## Modes

| Mode | Command | Description |
|------|---------|-------------|
| `copy` | `node index.js copy 0.01` | Copy whale trades (paper by default) |
| `watch` | `node index.js watch` | Watch whale txs live |
| `scan` | `node index.js scan` | Scan arb opportunities |
| `paper` | `node index.js paper` | Full paper trading sim |
| `analyze` | `node index.js analyze` | Wallet pattern analysis |
| `safety` | `node index.js safety <mint>` | Token rug check |

## .env Setup

```env
PRIVATE_KEY=your_base58_private_key   # leave blank for watch-only
RPC_URL=https://mainnet.helius-rpc.com/?api-key=YOUR_KEY
HELIUS_API_KEY=your_helius_key        # free at dev.helius.xyz
BOT_TOKEN=telegram_bot_token          # for alerts
CHAT_ID=your_telegram_chat_id
MAX_TRADE_SOL=0.01                    # safety limit per trade
MIN_PROFIT_PCT=0.5
```

## Architecture

```
Helius WebSocket → whale tx detected
        ↓
parseTransaction() → decode token changes
        ↓
Jupiter quote → can we route? 
        ↓ (if no route)
Pump.fun DAS check → bonding curve token?
        ↓
safety check → price impact < 50%?
        ↓
paper: log trade | live: executeRealSwap()
        ↓
Telegram alert sent
```

## Key Files

- `src/copy_trade.js` — Core copy trader engine
- `src/wallet_tracker.js` — Helius WebSocket + tx parsing
- `src/arbitrage.js` — Jupiter arb scanner
- `src/pumpfun.js` — Pump.fun token metadata via Helius DAS
- `src/sniper.js` — New token sniper (paper mode)
- `src/config.js` — Wallet + connection setup
- `src/alerts.js` — Telegram notifications

## Live → Paper Switch

In `copy_trade.js` `startCopyTrader()`:
```js
paper: true   // paper mode (safe, no real money)
paper: false  // LIVE mode — real trades
```

Or use `index.js` mode `copy` (always paper) vs direct `startCopyTrader({ paper: false })`.

## Safety Limits

- `MAX_TRADE_SOL` — max SOL per trade (default 0.01)
- `maxPositions: 3` — max open positions at once
- `priceImpact > 50%` → skip (rug protection)
- Pump safety score < 40 → skip

## Whale to Copy

Default whale: `AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51`
- Confirmed MEV bot: 477 SOL, 172K txs/day, $40K/day
- Change in `src/copy_trade.js` → `WHALE` constant

## Requirements

- Node.js 18+
- Free Helius API key (1000 req/day free tier)
- Solana wallet (optional — watch-only without)
- Telegram bot (optional — for alerts)

See `references/api-setup.md` for getting free API keys.
See `references/trading-concepts.md` for how Solana MEV/arb works.

Overview

This skill is a Solana whale copy-trading bot that tracks any wallet in real time and can mirror trades via Jupiter and Pump.fun APIs. It supports paper trading simulation and live execution, plus watch-only modes and an arbitrage scanner. The tool is built to detect whale transactions, perform safety checks, and optionally execute swaps while sending alerts to Telegram.

How this skill works

The bot listens to Helius WebSocket events to detect wallet transactions, parses token movements, and decodes swap intents. It queries Jupiter for routing and quotes, consults Pump.fun/DAS metadata for token risk signals, and runs safety filters (price impact, pump score, max trade size). Depending on mode, it either logs simulated trades or submits real Jupiter swaps and posts Telegram alerts.

When to use it

  • You want to copy trades from a specific Solana whale in real time.
  • You need a safe paper trading environment to validate copy strategies before risking capital.
  • You want to monitor whale activity and token launches for early signals or arbitrage.
  • You need an automated arb scanner to surface potential Jupiter routes.
  • You want an autonomous Solana trading bot with configurable safety limits.

Best practices

  • Start in paper mode and validate behavior against known whale transactions before enabling live execution.
  • Set conservative MAX_TRADE_SOL and maxPositions to limit exposure and reduce tail-risk.
  • Use the pump.fun DAS and price-impact checks to avoid bonding-curve or rug-prone tokens.
  • Enable Telegram alerts and monitor logs for unexpected patterns or repeated failures.
  • Keep Helius API keys and RPC endpoints on a secure environment file and rotate keys periodically.

Example use cases

  • Paper-copy a high-volume MEV bot to study its trade patterns without risking funds.
  • Automatically mirror a vetted whale’s trades with tight max trade size and Telegram notifications.
  • Run the arbitrage scanner to find Jupiter routes with positive expected returns across pools.
  • Watch for new token launches indexed by Pump.fun and run automated safety checks before trading.
  • Analyze an address’s historical behavior with the analyze mode to refine copy rules.

FAQ

Is there a safe way to test before live trading?

Yes. The default copy mode runs in paper (simulated) mode. Switch to live only after testing and adjusting safety limits.

What safeguards prevent rug or high-impact trades?

The bot enforces MAX_TRADE_SOL, maxPositions, price-impact thresholds, and pump.fun safety scores; trades failing checks are skipped.

Do I need a private key to use the watcher or scanner?

No. Watch-only and scan modes work without a private key. A key is required only for live execution.