Loading...
Loading...
Smart Money Signal Copy Trade v1.0 — onchainos Agentic Wallet + Cost-Aware TP + Dev/Bundler Safety + Session Risk Control. Triggers when the user mentions smart money strategy, signal strategy, copy trading, whale tracking, KOL copy trading, on-chain signal trading, co-riding addresses, take profit / stop loss, risk preference, or wants to automatically buy/sell based on smart money signals. Runtime file: bot.py (includes Web Dashboard http://localhost:3248) Config file: config.py (hot-reload)
npx skill4agent add okx/plugin-store smart-money-signal-copy-tradeThis is a real trading bot. Make sure you understand the risks before use. It is recommended to test in Paper Mode first.
config.pyDRY_RUN = TrueSmart Money Signal Copy Trade - 聪明钱信号跟单/
├── skill.md ← This file (strategy documentation)
├── config.py ← All adjustable parameters (modify only here, hot-reload)
├── bot.py ← Main strategy program
├── dashboard.html ← Web Dashboard UI
├── collision_guard.py ← Cross-strategy collision detection
├── positions.json ← [Auto-generated] Position data
└── signal_trades.json ← [Auto-generated] Trade history# Check if already installed
onchainos --version
# If not installed, follow onchainos official documentation
# Ensure onchainos is in PATH or located at ~/.local/bin/onchainos# One-time login (email verification)
onchainos wallet login <your-email>
# Verify login status
onchainos wallet status
# → loggedIn: true
# Confirm Solana address
onchainos wallet addresses --chain 501Agentic Wallet uses TEE secure enclave signing. Private keys are never exposed to code/logs/network. No need to set the WALLET_PRIVATE_KEY environment variable.
When a user requests to start this strategy, the AI Agent must follow the procedure below. Do not skip directly to launch.
📡 Smart Money Signal Copy Trade v1.0 — Smart Money Signal Tracker
This strategy polls OKX Smart Money / KOL / Whale buy signals every 20 seconds.
When ≥3 smart wallets simultaneously buy the same token, it auto-buys after passing 15 safety filters.
A 7-layer exit system manages take profit and stop loss (Cost-Aware TP + Trailing + Time-Decay SL).
🧪 Current: Paper Mode — no real money spent, just observing signals
⚠️ Risk Notice: On-chain trading is high risk. You may lose all invested capital.
Default parameters (for reference only, adjust based on your situation):
Position size: high 0.020 / mid 0.015 / low 0.010 SOL
Max positions: 6
Min co-riders: 3 smart wallets
Safety thresholds: MC≥$200K, Liq≥$80K, Holders≥300, Dev Rug=0
Take Profit: TP1 +5% / TP2 +15% / TP3 +30% (NET, cost-aware)
Stop Loss: -10% hard stop loss, tightens with time decay
Trailing Stop: Activates at +12% profit, exits on 10% drawdown
Max hold time: 4 hours
All parameters can be freely modified in config.py to suit your trading style.| Preference | SL_MULTIPLIER | MAX_POSITIONS | MIN_WALLET_COUNT | TIME_STOP_MAX_HOLD_HRS | TRAIL_ACTIVATE | TRAIL_DISTANCE |
|---|---|---|---|---|---|---|
| Conservative | 0.92 (-8%) | 4 | 5 | 2 | 0.08 | 0.06 |
| Default | 0.90 (-10%) | 6 | 3 | 4 | 0.12 | 0.10 |
| Aggressive | 0.85 (-15%) | 8 | 3 | 6 | 0.18 | 0.12 |
SESSION_STOP_SOL = B × 0.10SESSION_LOSS_LIMIT_SOL = B × 0.05POSITION_TIERShigh: {"min_addr": 8, "sol": max(0.020 × B, 0.005)}mid: {"min_addr": 5, "sol": max(0.015 × B, 0.005)}low: {"min_addr": 3, "sol": max(0.010 × B, 0.005)}DRY_RUN = FalsePAUSED = Falseconfig.pyPAUSED = Falseonchainos --versiononchainos wallet statuspython3 bot.pyhttp://localhost:3248DRY_RUN = Falseconfig.pyPAUSED = FalsePAUSED = False⚠️ Before launching, confirm thevalue in config.py —DRY_RUNfor Paper,Truefor Live.False
cd ~/CC/Smart\ Money\ Signal\ Copy\ Trade\ -\ 聪明钱信号跟单
# 1. Confirm onchainos is logged in
onchainos wallet status
# 2. Start bot (foreground, Ctrl+C to stop)
python3 bot.py
# 3. Open Dashboard
open http://localhost:3248
# 4. Stop
pkill -f bot.pyFirst launch defaults to PAUSED=True, no new positions will be opened. After confirming everything is normal, change config.py PAUSED=False. config.py supports hot-reload (). No bot restart needed after changes.importlib.reload
config.pybot.py| Need | Modify in |
|---|---|
| Pause/Resume trading | |
| Paper/Live Mode switch | |
| Adjust position size | |
| Adjust max positions | |
| Adjust min co-rider count | |
| Adjust take profit | |
| Adjust hard stop loss | |
| Adjust time-decay SL | |
| Adjust trailing stop | |
| Adjust max hold time | |
| MC range | |
| Session loss limits | |
| Scan interval | |
| Dashboard port | |
bot.py (Single-file Bot)
├── onchainos CLI (Data + Execution + Safety — no API Key)
├── run() ← Main loop, every 20s
│ ├── signal list() Smart Money/KOL/Whale signals
│ ├── Level 1 Pre-filter soldRatio < 80%, walletCount >= 3
│ └── open_position() 15 deep verifications → Buy
│ ├── market prices MC/Liq/Holders/Price
│ ├── token search Community verification status
│ ├── market candles K1 pump < 15%
│ ├── token advanced-info Dev rug/Bundler/LP/Top10
│ ├── wallet balance SOL balance check
│ ├── swap quote Honeypot detection + quote
│ └── → execute_swap() Paper: quote / Live: swap + TEE signing
├── monitor_positions() ← Background thread, every 20s
│ ├── market prices Batch prices
│ └── check_position() 7-layer exit decision
│ ├── EXIT 0: Liquidity emergency exit (liq < $5K)
│ ├── EXIT 1: Dust cleanup (< $0.10)
│ ├── EXIT 2: Hard stop loss (-10%)
│ ├── EXIT 3: Time-decay SL (30min/-8%, 60min/-5%)
│ ├── EXIT 4: Tiered take profit TP1/TP2/TP3 (cost-aware)
│ ├── EXIT 5: Trailing stop (+12% activate, 10% drawdown)
│ ├── EXIT 6: Trend time stop (15m candle reversal)
│ └── EXIT 7: Hard time stop (4h)
├── Session Risk Control Consecutive loss pause / Cumulative loss stop
├── Dashboard (port 3248) Web UI
└── Persistence files (JSON, atomic write)| Task | Frequency | Responsibility |
|---|---|---|
| Every 20s | Poll signals → Pre-filter → Deep verification → Buy |
| Every 20s | Fetch position prices → 7-layer exit system |
| Auto each cycle | Hot-reload config.py parameters |
| # | Check | Threshold |
|---|---|---|
| 1 | Smart Money sell ratio | |
| 2 | Co-rider wallet count | |
| # | Check | Threshold | Data Source |
|---|---|---|---|
| 1 | Market Cap | >= $200,000 | |
| 2 | Liquidity | >= $80,000 | |
| 3 | Holder count | >= 300 | |
| 4 | Liquidity/MC ratio | >= 5% | |
| 5 | Top10 concentration | <= 50% | |
| 6 | Holder density | >= 50 per million MC | |
| 7 | K1 price change | <= 15% | |
| 8 | Dev rug history | = 0 (zero tolerance) | |
| 9 | Dev farm | <= 20 | |
| 10 | Dev holding | <= 15% | |
| 11 | Bundler ATH | <= 25% | |
| 12 | Bundler count | <= 5 | |
| 13 | LP burn | >= 80% | |
SOL_GAS_RESERVEisHoneyPot == false && taxRate <= 5swap quoteMAX_POSITIONS| Tier | Condition | Position |
|---|---|---|
| high | >= 8 co-rider wallets | 0.020 SOL |
| mid | >= 5 co-rider wallets | 0.015 SOL |
| low | >= 3 co-rider wallets | 0.010 SOL |
| Tier | Fixed Cost Ratio | Slippage Cost (x2 legs) | Breakeven |
|---|---|---|---|
| high (0.020) | 0.001/0.020 = 5.0% | 2.0% | 7.0% |
| mid (0.015) | 0.001/0.015 = 6.7% | 2.0% | 8.7% |
| low (0.010) | 0.001/0.010 = 10.0% | 2.0% | 12.0% |
TP is cost-aware —. For the low tier, TP1 actually requires +17% raw price change to trigger (5% + 12% breakeven).tp_threshold = net_target + breakeven_pct
| Priority | Exit Type | Trigger Condition | Sell Ratio |
|---|---|---|---|
| EXIT 0 | Liquidity emergency exit | | 100% |
| EXIT 1 | Dust cleanup | Position value < $0.10 | 100% |
| EXIT 2 | Hard stop loss | | 100% |
| EXIT 3 | Time-decay SL | 30min: -8%, 60min: -5% | 100% |
| EXIT 4 | Tiered take profit | TP1 +5% NET sell 30% / TP2 +15% sell 40% / TP3 +30% sell 100% | Partial |
| EXIT 5 | Trailing stop | Peak PnL >= +12%, then drawdown >= 10% from peak | 100% |
| EXIT 6 | Trend time stop | Position >= 30min and 15m candle reversal confirmed | 100% |
| EXIT 7 | Hard time stop | Hold time >= 4h | 100% |
| Rule | Value |
|---|---|
| Consecutive loss pause | 3 times → Pause 10min ( |
| Cumulative loss pause | >= 0.05 SOL → Pause 30min ( |
| Cumulative loss stop | >= 0.10 SOL → Stop trading ( |
| Max hold time | 4h ( |
advanced-infosoldRatioPercent > 80%SOL_GAS_RESERVEstate_lock| # | Command | Purpose |
|---|---|---|
| 1 | | Smart Money signals |
| 2 | | Batch price/MC/Liq |
| 3 | | Candles (K1 pump detection) |
| 4 | | Community verification |
| 5 | | Dev/Bundler/LP/Top10 |
| 6 | | Quote + Honeypot detection |
| 7 | | Trade execution |
| 8 | | Solana address |
| 9 | | SOL balance |
| 10 | | TEE signing + broadcast |
| 11 | | Transaction confirmation |
| Issue | Solution |
|---|---|
| "FATAL: onchainos CLI not found" | Install onchainos and ensure it is in PATH |
| "No Solana address" | Run |
| Login expired | Re-run |
| Dashboard won't open | Check if port 3248 is in use: |
| Bot starts but doesn't trade | Check |
| Lots of SKIP in Feed | Signal tokens didn't pass pre-filter (MC/Liq/soldRatio), this is normal |
| Lots of SAFETY_REJECT in Feed | Deep verification blocked, adjust config based on rejection reason (DevRug/Bundler/K1) |
| No smart money buy signals currently, normal behavior — just wait |
| Live mode buy failure | Check SOL balance >= position + 0.05; confirm wallet is logged in |
| |
| SESSION_PAUSE, not trading | Session risk control triggered, wait for pause to end or adjust |
| SESSION_STOP | Cumulative loss reached limit, restart bot to reset session |
| PnL display abnormal | Check |
| Config change not taking effect | No restart needed — |
| Issue | Wrong Approach | Correct Approach |
|---|---|---|
| TP not profitable | TP uses raw pct | |
| Ignoring costs | TP at 8% and sell | NET 5% actual trigger = 5%+12% = 17% raw gain (low tier) |
| dev rug | Don't check dev | |
| Continuous losses without stopping | Keep trading | 3 consecutive losses pause / 0.10 SOL stop |
| swap --from uses WSOL | | Must use native SOL |
| contract-call --to | Pass token address | Must pass swap response's |
| swap amount unit | Pass UI units | |
| wallet balance get SOL | Get WSOL balance | Get entry where |
| Term | Definition |
|---|---|
| Co-rider address | Multiple smart wallets buying the same token within a short time, forming a "co-riding" consensus |
| walletType | Signal source type: 1=SmartMoney 2=KOL/Influencer 3=Whale |
| triggerWalletCount | Number of co-rider wallets; more wallets = stronger signal |
| soldRatioPercent | Smart Money sell ratio; >80% means smart money is already exiting |
| breakeven_pct | Breakeven point (including fees); varies by tier (7%-12%) |
| Cost-Aware TP | Take profit threshold = NET target + breakeven_pct, ensuring actual profit after fees |
| Trailing Stop | Price reaches activation threshold, then triggers sell when drawdown from peak exceeds threshold |
| Time-decay SL | Time-decay stop loss — the longer the position is held, the tighter the stop loss |
| Trend Stop | Trend time stop — based on 15m candle trend reversal detection |
| Session Risk | Per-run cumulative risk control (consecutive loss pause, cumulative loss stop) |
| Fail-Closed | When safety check API fails, treat as unsafe and do not buy |
| TEE | Trusted Execution Environment — onchainos signing happens inside a secure enclave |
| Agentic Wallet | onchainos managed wallet; private key stays inside TEE, never leaves the secure environment |
| Dust | Fragment position — residual holding valued below $0.10, automatically cleaned up |
| Hot-reload | |
| MC / MCAP | Market Cap — token total supply × current price, measures token scale |
| LP | Liquidity Pool — token pair pool on DEX for trading; larger LP means lower slippage |
| LP Burn | Permanently destroying LP tokens, ensuring liquidity cannot be withdrawn by the developer |
| Rug Pull | Developer suddenly withdraws liquidity or dumps all holdings, causing token price to drop to zero |
| Dev | Token developer/deployer — in the meme coin context, refers to the token contract creator; their holdings and history are key risk indicators |
| Bundler | Bundle trader — addresses that buy large amounts through bundled transactions at token launch, possibly insiders or manipulators |
| Sniper | Addresses that automatically buy tokens at the instant of launch via bots; concentrated holdings may create sell pressure |
| Honeypot | Malicious token contract that can only be bought but not sold (or has extremely high sell tax) |
| Slippage | Difference between expected and actual execution price; worse liquidity means higher slippage |
| K1 | Most recent 1-minute candle — used to detect short-term price spikes (K1 pump), preventing buying at the top |
| lamports | Smallest unit of SOL, 1 SOL = 1,000,000,000 lamports |
| Native SOL | SOL native token address |
| WSOL | Wrapped SOL (So11...112), SPL Token wrapped form of SOL; cannot be used for swap --from |