smart-money-signal-copy-trade

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Smart Money Signal Copy Trade v1.0

Smart Money 信号跟单交易 v1.0

This is a real trading bot. Make sure you understand the risks before use. It is recommended to test in Paper Mode first.

这是一个真实的交易机器人。使用前请务必了解风险。建议先在模拟模式(Paper Mode)下测试。

Disclaimer

免责声明

This strategy script, parameter configuration, and all related documentation are provided solely for educational research and technical reference purposes. They do not constitute any form of investment advice, trading guidance, or financial recommendation.
  1. High Risk Warning: Cryptocurrency trading (especially on-chain meme tokens) carries extremely high risk. Prices may fluctuate drastically or drop to zero within seconds. You may lose all invested capital.
  2. Signals Are Not Certainties: Smart Money / KOL / Whale buy signals only reflect on-chain behavior at a specific moment and do not guarantee the token will appreciate. Signal sources may have delays, misjudgments, or manipulation. Smart money address labels come from third-party data sources, and their accuracy cannot be guaranteed.
  3. Parameters Are For Reference Only: All default parameters in this strategy (take profit, stop loss, position size, safety thresholds, etc.) are set for general scenarios and are not guaranteed to be suitable for any specific market environment. Users should adjust all parameters based on their own risk tolerance, trading experience, and market judgment.
  4. User Customization Encouraged: Users are encouraged to deeply understand the meaning of each parameter and modify them according to their own strategy logic and risk preferences. Every parameter in
    config.py
    is annotated with comments for easy customization.
  5. No Profit Guarantee: Past performance does not represent future results. Even parameters that perform well in backtesting may fail in live trading due to changing market conditions.
  6. Technical Risk: On-chain transactions are irreversible. Smart contracts may contain vulnerabilities. Network congestion may cause transaction delays or failures.
  7. Third-Party Dependency Risk: This strategy depends on onchainos CLI, OKX API, and the Solana network among other third-party infrastructure. Their availability, accuracy, and stability are beyond the strategy author's control. Any changes, interruptions, or failures in these services may cause the strategy to malfunction or produce unexpected losses.
  8. Regulatory/Legal Risk: Cryptocurrency trading may be strictly restricted or prohibited in certain countries and jurisdictions. Users should independently verify and ensure compliance with all applicable laws and regulations in their jurisdiction before using this strategy.
  9. Tax Risk: Frequent trading may generate numerous taxable events. Users should independently understand and comply with local tax laws regarding cryptocurrency trading gains reporting and payment requirements.
  10. Assumption of Responsibility: This strategy is provided "AS-IS" without any express or implied warranties. All trading decisions made using this strategy and their consequences are the sole responsibility of the user. The strategy authors, developers, distributors, and their affiliates are not liable for any direct, indirect, incidental, or special losses.
Recommendation: For first-time use, run in Paper Mode (
DRY_RUN = True
). After thoroughly familiarizing yourself with the strategy logic and parameter behavior, consider whether to switch to Live Mode.

本策略脚本、参数配置及所有相关文档仅用于教育研究和技术参考目的,不构成任何形式的投资建议、交易指导或财务推荐。
  1. 高风险警告:加密货币交易(尤其是链上迷因币)风险极高。价格可能在数秒内大幅波动或跌至零。您可能损失全部投资本金。
  2. 信号不代表确定性:聪明钱/KOL/巨鲸买入信号仅反映特定时刻的链上行为,不保证代币会升值。信号来源可能存在延迟、误判或操纵。聪明钱地址标签来自第三方数据源,其准确性无法保证。
  3. 参数仅供参考:本策略中的所有默认参数(止盈、止损、仓位大小、安全阈值等)均针对通用场景设置,不保证适用于任何特定市场环境。用户应根据自身风险承受能力、交易经验和市场判断调整所有参数。
  4. 鼓励用户自定义:鼓励用户深入理解每个参数的含义,并根据自身策略逻辑和风险偏好进行修改。
    config.py
    中的每个参数都附有注释,方便自定义。
  5. 无盈利保证:过往业绩不代表未来结果。即使在回测中表现良好的参数,也可能因市场环境变化在实盘交易中失效。
  6. 技术风险:链上交易不可逆。智能合约可能存在漏洞。网络拥堵可能导致交易延迟或失败。
  7. 第三方依赖风险:本策略依赖onchainos CLI、OKX API和Solana网络等第三方基础设施。它们的可用性、准确性和稳定性不受策略作者控制。这些服务的任何变更、中断或故障都可能导致策略故障或产生意外损失。
  8. 监管/法律风险:加密货币交易在某些国家和地区可能受到严格限制或禁止。用户在使用本策略前应独立核实并确保遵守所在司法管辖区的所有适用法律法规。
  9. 税务风险:频繁交易可能产生大量应税事件。用户应独立了解并遵守当地关于加密货币交易收益申报和支付要求的税法。
  10. 责任承担:本策略按“原样”提供,不提供任何明示或暗示的担保。使用本策略做出的所有交易决策及其后果均由用户自行负责。策略作者、开发者、发行商及其关联方不对任何直接、间接、偶然或特殊损失承担责任。
建议:首次使用时,在模拟模式(
DRY_RUN = True
)下运行。在彻底熟悉策略逻辑和参数行为后,再考虑是否切换到实盘模式。

File Structure

文件结构

Smart 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

Smart Money Signal Copy Trade - 聪明钱信号跟单/
├── skill.md              ← 本文件(策略文档)
├── config.py             ← 所有可调参数(仅在此修改,支持热重载)
├── bot.py                ← 主策略程序
├── dashboard.html        ← Web仪表盘UI
├── collision_guard.py    ← 跨策略冲突检测
├── positions.json        ← [自动生成] 仓位数据
└── signal_trades.json    ← [自动生成] 交易历史

Prerequisites

前置条件

1. Install onchainos CLI (>= 2.0.0-beta)

1. 安装 onchainos CLI(版本 ≥ 2.0.0-beta)

bash
undefined
bash
undefined

Check if already installed

检查是否已安装

onchainos --version
onchainos --version

If not installed, follow onchainos official documentation

若未安装,请遵循onchainos官方文档

Ensure onchainos is in PATH or located at ~/.local/bin/onchainos

确保onchainos在PATH中或位于~/.local/bin/onchainos

undefined
undefined

2. Log in to Agentic Wallet (TEE Signing)

2. 登录 Agentic Wallet(TEE签名)

bash
undefined
bash
undefined

One-time login (email verification)

一次性登录(邮箱验证)

onchainos wallet login <your-email>
onchainos wallet login <your-email>

Verify login status

验证登录状态

onchainos wallet status
onchainos wallet status

→ loggedIn: true

→ loggedIn: true

Confirm Solana address

确认Solana地址

onchainos wallet addresses --chain 501

> Agentic 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.
onchainos wallet addresses --chain 501

> Agentic Wallet 使用TEE安全飞地签名。私钥永远不会暴露给代码/日志/网络。
> 无需设置WALLET_PRIVATE_KEY环境变量。

3. No pip install Required

3. 无需pip安装

This strategy only depends on the Python standard library + onchainos CLI. No third-party packages are needed.

本策略仅依赖Python标准库 + onchainos CLI,无需第三方包。

AI Agent Startup Interaction Protocol

AI Agent 启动交互协议

When a user requests to start this strategy, the AI Agent must follow the procedure below. Do not skip directly to launch.
当用户请求启动本策略时,AI Agent必须遵循以下流程,不得直接跳过至启动步骤。

Phase 1: Present Strategy Overview

阶段1:展示策略概述

Show the user the following:
📡 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.
向用户展示以下内容:
📡 Smart Money 信号跟单交易 v1.0 —— 聪明钱信号追踪器

本策略每20秒轮询OKX聪明钱/KOL/巨鲸买入信号。
当≥3个聪明钱包同时买入同一代币时,通过15项安全过滤后自动买入。
7层退出系统管理止盈和止损(成本感知止盈 + 追踪止损 + 时间衰减止损)。

🧪 当前状态:模拟模式 —— 不使用真实资金,仅观察信号

⚠️ 风险提示:链上交易风险极高,您可能损失全部投资本金。

默认参数(仅供参考,请根据自身情况调整):
  仓位大小:高风险0.020 / 中等0.015 / 低风险0.010 SOL
  最大仓位数量:6
  最小跟车钱包数:3个聪明钱包
  安全阈值:市值≥20万美元,流动性≥8万美元,持有者≥300,开发者跑路风险=0
  止盈:TP1 +5% / TP2 +15% / TP3 +30%(扣除成本后净收益)
  止损:-10%硬止损,随时间衰减收紧
  追踪止损:盈利+12%时激活,从峰值回撤10%时退出
  最大持有时间:4小时

所有参数可在config.py中自由修改,以适配您的交易风格。

Q1: Risk Preference (Mandatory)

Q1:风险偏好(必填)

  • 🛡️ Conservative: Small positions, tight stop loss, fewer positions
  • ⚖️ Default: Balanced configuration (recommended)
  • 🔥 Aggressive: Large positions, wide stop loss, more positions
→ Parameter mapping (for AI Agent to write to config.py, not shown to user):
PreferenceSL_MULTIPLIERMAX_POSITIONSMIN_WALLET_COUNTTIME_STOP_MAX_HOLD_HRSTRAIL_ACTIVATETRAIL_DISTANCE
Conservative0.92 (-8%)4520.080.06
Default0.90 (-10%)6340.120.10
Aggressive0.85 (-15%)8360.180.12
  • 🛡️ 保守型:仓位小,止损严格,仓位数量少
  • ⚖️ 默认:平衡配置(推荐)
  • 🔥 激进型:仓位大,止损宽松,仓位数量多
→ 参数映射(AI Agent写入config.py,不展示给用户):
风险偏好SL_MULTIPLIERMAX_POSITIONSMIN_WALLET_COUNTTIME_STOP_MAX_HOLD_HRSTRAIL_ACTIVATETRAIL_DISTANCE
保守型0.92(-8%)4520.080.06
默认0.90(-10%)6340.120.10
激进型0.85(-15%)8360.180.12

Q2: Switch to Live Trading?

Q2:切换至实盘交易?

  • A. 🧪 Stay in Paper Mode, launch directly (recommended default)
  • B. 💰 Switch to Live Mode
Option A → Proceed directly to launch steps.
Option B → Enter Live Mode sub-flow:
  1. ⚠️ Confirm with user: "Live Mode will use real SOL for trading. Losses are irreversible. Confirm switch to Live Mode?"
    • User confirms → Continue
    • User declines → Fall back to Paper Mode
  2. Ask for total budget in SOL (range 0.5-10, default 1.0 SOL)
  3. AI auto-calculates (let B = user's budget input):
    • SESSION_STOP_SOL = B × 0.10
      (stop at 10% loss)
    • SESSION_LOSS_LIMIT_SOL = B × 0.05
      (pause at 5% loss)
    • POSITION_TIERS
      :
      • high: {"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)}
  4. Show calculated results to user and confirm: "Your Live Mode config: Total budget X SOL, per-trade high/mid/low = Y/Y/Y SOL, loss stop limit Z SOL. Confirm?"
    • User confirms → Write to config.py
    • User requests adjustments → Return to step 2
  5. Set mode parameters:
    • DRY_RUN = False
    • PAUSED = False
  • A. 🧪 保持模拟模式,直接启动(推荐默认)
  • B. 💰 切换至实盘模式
选项A → 直接进入启动步骤。
选项B → 进入实盘模式子流程:
  1. ⚠️ 向用户确认: "实盘模式将使用真实SOL进行交易。损失不可逆。确认切换至实盘模式?"
    • 用户确认 → 继续
    • 用户拒绝 → 退回模拟模式
  2. 询问用户SOL总预算(范围0.5-10,默认1.0 SOL)
  3. AI自动计算(设B为用户输入的预算):
    • SESSION_STOP_SOL = B × 0.10
      (损失10%时停止)
    • SESSION_LOSS_LIMIT_SOL = B × 0.05
      (损失5%时暂停)
    • POSITION_TIERS
      • high: {"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)}
  4. 向用户展示计算结果并确认: "您的实盘模式配置:总预算X SOL,每笔交易高/中/低仓位=Y/Y/Y SOL,损失停止限额Z SOL。确认?"
    • 用户确认 → 写入config.py
    • 用户要求调整 → 返回步骤2
  5. 设置模式参数:
    • DRY_RUN = False
    • PAUSED = False

Launch

启动

  1. Modify corresponding parameters in
    config.py
    based on user responses
  2. Set
    PAUSED = False
    (allow bot to run normally after interaction confirmation)
  3. Check prerequisites:
    onchainos --version
    ,
    onchainos wallet status
  4. Start bot:
    python3 bot.py
  5. Show Dashboard link:
    http://localhost:3248
  6. Inform user: Currently in Paper Mode. To switch to Live Mode, change
    DRY_RUN = False
    in
    config.py
If user says "use default config" or "just run it", only set
PAUSED = False
, leave everything else unchanged, and launch in Paper Mode.
  1. 根据用户响应修改
    config.py
    中的对应参数
  2. 设置
    PAUSED = False
    (交互确认后允许机器人正常运行)
  3. 检查前置条件:
    onchainos --version
    onchainos wallet status
  4. 启动机器人:
    python3 bot.py
  5. 展示仪表盘链接:
    http://localhost:3248
  6. 告知用户:当前处于模拟模式。如需切换至实盘模式,请修改
    config.py
    中的
    DRY_RUN = False
如果用户说"使用默认配置"或"直接运行",仅设置
PAUSED = False
,其余参数保持不变,并以模拟模式启动。

Special Cases

特殊情况

  • User explicitly says "don't ask me, just run" → Launch with default parameters (Paper Mode), but must show Phase 1 overview + set
    PAUSED = False
  • User is a returning user (config history exists in conversation) → Remind of previous config, ask whether to reuse

  • 用户明确表示"别问我,直接运行" → 使用默认参数启动(模拟模式),但必须展示阶段1概述 + 设置
    PAUSED = False
  • 用户为返回用户(对话中存在配置历史) → 提醒之前的配置,询问是否复用

Quick Start

快速开始

⚠️ Before launching, confirm the
DRY_RUN
value in config.py —
True
for Paper,
False
for Live.
bash
cd ~/CC/Smart\ Money\ Signal\ Copy\ Trade\ -\ 聪明钱信号跟单
⚠️ 启动前,请确认config.py中的
DRY_RUN
值 ——
True
为模拟模式,
False
为实盘模式。
bash
cd ~/CC/Smart\ Money\ Signal\ Copy\ Trade\ -\ 聪明钱信号跟单

1. Confirm onchainos is logged in

1. 确认onchainos已登录

onchainos wallet status
onchainos wallet status

2. Start bot (foreground, Ctrl+C to stop)

2. 启动机器人(前台运行,按Ctrl+C停止)

python3 bot.py
python3 bot.py

3. Open Dashboard

3. 打开仪表盘

4. Stop

4. 停止机器人

pkill -f bot.py

> **First 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 (`importlib.reload`). No bot restart needed after changes.

---
pkill -f bot.py

> **首次启动默认设置为PAUSED=True,不会开新仓位。确认一切正常后,修改config.py中的PAUSED=False。**
> config.py支持热重载(`importlib.reload`)。修改后无需重启机器人。

---

Parameter Tuning

参数调优

All adjustable parameters are in
config.py
— no need to modify
bot.py
.
所有可调参数均在
config.py
—— 无需修改
bot.py

Common Adjustments

常见调整

NeedModify in
config.py
Pause/Resume trading
PAUSED = True/False
Paper/Live Mode switch
DRY_RUN = True/False
Adjust position size
sol
values in
POSITION_TIERS
for each tier
Adjust max positions
MAX_POSITIONS = 6
Adjust min co-rider count
MIN_WALLET_COUNT = 3
Adjust take profit
pct
and
sell
in
TP_TIERS
Adjust hard stop loss
SL_MULTIPLIER = 0.90
(-10%)
Adjust time-decay SL
TIME_DECAY_SL
list
Adjust trailing stop
TRAIL_ACTIVATE = 0.12
,
TRAIL_DISTANCE = 0.10
Adjust max hold time
TIME_STOP_MAX_HOLD_HRS = 4
MC range
MIN_MCAP = 200_000
,
MIN_LIQUIDITY = 80_000
Session loss limits
SESSION_STOP_SOL = 0.10
,
SESSION_LOSS_LIMIT_SOL = 0.05
Scan interval
POLL_INTERVAL_SEC = 20
Dashboard port
DASHBOARD_PORT = 3248
Changes take effect automatically via hot-reload (no bot restart needed).

需求
config.py
中修改
暂停/恢复交易
PAUSED = True/False
切换模拟/实盘模式
DRY_RUN = True/False
调整仓位大小
POSITION_TIERS
中各层级的
sol
调整最大仓位数量
MAX_POSITIONS = 6
调整最小跟车钱包数
MIN_WALLET_COUNT = 3
调整止盈
TP_TIERS
中的
pct
sell
调整硬止损
SL_MULTIPLIER = 0.90
(-10%)
调整时间衰减止损
TIME_DECAY_SL
列表
调整追踪止损
TRAIL_ACTIVATE = 0.12
TRAIL_DISTANCE = 0.10
调整最大持有时间
TIME_STOP_MAX_HOLD_HRS = 4
市值范围
MIN_MCAP = 200_000
MIN_LIQUIDITY = 80_000
会话损失限额
SESSION_STOP_SOL = 0.10
SESSION_LOSS_LIMIT_SOL = 0.05
扫描间隔
POLL_INTERVAL_SEC = 20
仪表盘端口
DASHBOARD_PORT = 3248
修改通过热重载自动生效(无需重启机器人)。

Strategy Architecture

策略架构

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)
Scheduled Tasks:
TaskFrequencyResponsibility
run()
Every 20sPoll signals → Pre-filter → Deep verification → Buy
monitor_positions()
Every 20sFetch position prices → 7-layer exit system
importlib.reload(config)
Auto each cycleHot-reload config.py parameters

bot.py(单文件机器人)
├── onchainos CLI(数据 + 执行 + 安全 —— 无需API密钥)
├── run()                  ← 主循环,每20秒执行一次
│   ├── signal list()              聪明钱/KOL/巨鲸信号
│   ├── Level 1 Pre-filter         卖出占比 < 80%,钱包数量 >= 3
│   └── open_position()            15项深度验证 → 买入
│       ├── market prices           市值/流动性/持有者/价格
│       ├── token search            社区验证状态
│       ├── market candles          K1涨幅 < 15%
│       ├── token advanced-info     开发者跑路风险/打包者/流动性池/前10持有者
│       ├── wallet balance          SOL余额检查
│       ├── swap quote              蜜罐检测 + 报价
│       └── → execute_swap()        模拟模式:仅报价 / 实盘模式:交易 + TEE签名
├── monitor_positions()    ← 后台线程,每20秒执行一次
│   ├── market prices               批量获取价格
│   └── check_position()            7层退出决策
│       ├── EXIT 0: 流动性紧急退出(流动性 < 5000美元)
│       ├── EXIT 1: 小额持仓清理(持仓价值 < 0.10美元)
│       ├── EXIT 2: 硬止损(价格 <= 入场价 × 0.90,即-10%)
│       ├── EXIT 3: 时间衰减止损(30分钟/-8%,60分钟/-5%)
│       ├── EXIT 4: 分层止盈TP1/TP2/TP3(成本感知)
│       ├── EXIT 5: 追踪止损(盈利≥+12%激活,从峰值回撤≥10%时退出)
│       ├── EXIT 6: 趋势时间止损(持仓≥30分钟且15分钟蜡烛图确认反转)
│       └── EXIT 7: 强制时间止损(持有时间≥4小时)
├── Session Risk Control     连续损失暂停 / 累计损失停止
├── Dashboard(端口3248)    Web界面
└── 持久化文件(JSON,原子写入)
定时任务:
任务频率职责
run()
每20秒轮询信号 → 预过滤 → 深度验证 → 买入
monitor_positions()
每20秒获取持仓价格 → 7层退出系统
importlib.reload(config)
每个循环自动执行热重载config.py参数

Safety Checks

安全检查

Level 1 Pre-filter (2 checks, based on signal list data, 0 extra API calls)

一级预过滤(2项检查,基于信号列表数据,无需额外API调用)

#CheckThreshold
1Smart Money sell ratio
soldRatioPercent
< 80%
2Co-rider wallet count
triggerWalletCount
>= 3
#检查项阈值
1聪明钱卖出占比
soldRatioPercent
< 80%
2跟车钱包数量
triggerWalletCount
>= 3

Level 2 Deep Verification (13 checks, via onchainos CLI)

二级深度验证(13项检查,通过onchainos CLI)

#CheckThresholdData Source
1Market Cap>= $200,000
market prices
2Liquidity>= $80,000
market prices
3Holder count>= 300
market prices
4Liquidity/MC ratio>= 5%
market prices
5Top10 concentration<= 50%
token advanced-info
6Holder density>= 50 per million MC
market prices
7K1 price change<= 15%
market candles
8Dev rug history= 0 (zero tolerance)
token advanced-info
9Dev farm<= 20
token advanced-info
10Dev holding<= 15%
token advanced-info
11Bundler ATH<= 25%
token advanced-info
12Bundler count<= 5
token advanced-info
13LP burn>= 80%
token advanced-info
#检查项阈值数据源
1市值>= 200,000美元
market prices
2流动性>= 80,000美元
market prices
3持有者数量>= 300
market prices
4流动性/市值比例>= 5%
market prices
5前10持有者集中度<= 50%
token advanced-info
6持有者密度>= 每百万市值50个持有者
market prices
7K1价格变化<= 15%
market candles
8开发者跑路历史= 0(零容忍)
token advanced-info
9开发者农场数量<= 20
token advanced-info
10开发者持仓占比<= 15%
token advanced-info
11打包者历史最高持仓占比<= 25%
token advanced-info
12打包者数量<= 5
token advanced-info
13流动性池销毁比例>= 80%
token advanced-info

Final Pre-Buy Check

买入前最终检查

  • SOL balance >= position size +
    SOL_GAS_RESERVE
    (0.05)
  • Honeypot detection:
    isHoneyPot == false && taxRate <= 5
    (via
    swap quote
    )
  • Position count <
    MAX_POSITIONS
  • Not in cooldown / Session not paused/stopped

  • SOL余额 >= 仓位大小 +
    SOL_GAS_RESERVE
    (0.05)
  • 蜜罐检测:
    isHoneyPot == false && taxRate <= 5
    (通过
    swap quote
  • 持仓数量 <
    MAX_POSITIONS
  • 不在冷却期 / 会话未暂停/停止

Position Tiers

仓位层级

TierConditionPosition
high>= 8 co-rider wallets0.020 SOL
mid>= 5 co-rider wallets0.015 SOL
low>= 3 co-rider wallets0.010 SOL
Cost Model (Breakeven by tier):
TierFixed Cost RatioSlippage 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
tp_threshold = net_target + breakeven_pct
. For the low tier, TP1 actually requires +17% raw price change to trigger (5% + 12% breakeven).

层级条件仓位
>= 8个跟车钱包0.020 SOL
>= 5个跟车钱包0.015 SOL
>= 3个跟车钱包0.010 SOL
成本模型(各层级盈亏平衡点):
层级固定成本比例滑点成本(双向)盈亏平衡点
高(0.020)0.001/0.020 = 5.0%2.0%7.0%
中(0.015)0.001/0.015 = 6.7%2.0%8.7%
低(0.010)0.001/0.010 = 10.0%2.0%12.0%
止盈是成本感知的 ——
tp_threshold = 净目标收益 + 盈亏平衡点比例
。对于低层级,TP1实际需要+17%的原始价格涨幅才能触发(5%净收益 + 12%盈亏平衡点)。

7-Layer Exit System

7层退出系统

PriorityExit TypeTrigger ConditionSell Ratio
EXIT 0Liquidity emergency exit
liq < $5,000
100%
EXIT 1Dust cleanupPosition value < $0.10100%
EXIT 2Hard stop loss
price <= entry × 0.90
(-10%)
100%
EXIT 3Time-decay SL30min: -8%, 60min: -5%100%
EXIT 4Tiered take profitTP1 +5% NET sell 30% / TP2 +15% sell 40% / TP3 +30% sell 100%Partial
EXIT 5Trailing stopPeak PnL >= +12%, then drawdown >= 10% from peak100%
EXIT 6Trend time stopPosition >= 30min and 15m candle reversal confirmed100%
EXIT 7Hard time stopHold time >= 4h100%

优先级退出类型触发条件卖出比例
EXIT 0流动性紧急退出
liq < 5000美元
100%
EXIT 1小额持仓清理持仓价值 < 0.10美元100%
EXIT 2硬止损
price <= 入场价 × 0.90
(-10%)
100%
EXIT 3时间衰减止损30分钟:-8%,60分钟:-5%100%
EXIT 4分层止盈TP1 +5%净收益卖出30% / TP2 +15%净收益卖出40% / TP3 +30%净收益卖出100%部分卖出
EXIT 5追踪止损峰值盈利≥+12%,随后从峰值回撤≥10%100%
EXIT 6趋势时间止损持仓≥30分钟且15分钟蜡烛图确认反转100%
EXIT 7强制时间止损持有时间≥4小时100%

Session Risk Control

会话风险控制

RuleValue
Consecutive loss pause3 times → Pause 10min (
MAX_CONSEC_LOSS = 3
)
Cumulative loss pause>= 0.05 SOL → Pause 30min (
SESSION_LOSS_LIMIT_SOL = 0.05
)
Cumulative loss stop>= 0.10 SOL → Stop trading (
SESSION_STOP_SOL = 0.10
)
Max hold time4h (
TIME_STOP_MAX_HOLD_HRS = 4
)
Consecutive loss counter resets on a profitable trade. Session risk control auto-resets on bot restart.

规则数值
连续损失暂停3次 → 暂停10分钟(
MAX_CONSEC_LOSS = 3
累计损失暂停>= 0.05 SOL → 暂停30分钟(
SESSION_LOSS_LIMIT_SOL = 0.05
累计损失停止>= 0.10 SOL → 停止交易(
SESSION_STOP_SOL = 0.10
最大持有时间4小时(
TIME_STOP_MAX_HOLD_HRS = 4
连续损失计数器在盈利交易后重置。会话风险控制在机器人重启时自动重置。

Iron Rules (Must Not Be Violated)

铁则(不得违反)

  1. advanced-info
    safety check failure → Fail-Closed, do not buy.
  2. soldRatioPercent > 80%
    skip — Smart money is already selling, don't catch the falling knife.
  3. K1 price change > 15% skip — Don't chase pumps.
  4. Zero tolerance for Dev rug history — If there's a rug, don't buy.
  5. After selling a token, set cooldown. No re-buying during cooldown period.
  6. Position size is fixed per tier. No adding to positions.
  7. If all three levels of buy price fallback fail (price <= 0), do not open position.
  8. Daily loss limit reached → Stop all buying.
  9. SOL_GAS_RESERVE
    0.05 SOL is never spent on trades.
  10. Must hold
    state_lock
    before writing to positions.json.

  1. advanced-info
    安全检查失败 → 关闭交易,不得买入
  2. soldRatioPercent > 80%
    跳过 —— 聪明钱已在卖出,不要接飞刀。
  3. K1价格变化>15%跳过 —— 不要追高。
  4. 零容忍开发者跑路历史 —— 若存在跑路记录,不得买入。
  5. 卖出代币后设置冷却期。冷却期内不得重新买入
  6. 仓位大小按层级固定。不得加仓
  7. 若三次买入价格回落尝试均失败(价格<=0),不得开仓
  8. 达到每日损失限额 → 停止所有买入。
  9. SOL_GAS_RESERVE
    0.05 SOL永远不会用于交易。
  10. 必须在写入positions.json前持有
    state_lock

onchainos CLI Command Reference

onchainos CLI 命令参考

#CommandPurpose
1
onchainos signal list --chain solana --wallet-type 1,2,3 --min-address-count 3
Smart Money signals
2
onchainos market prices --tokens 501:<addr1>,501:<addr2>,...
Batch price/MC/Liq
3
onchainos market candles --chain solana --address <addr> --bar 1m
Candles (K1 pump detection)
4
onchainos token search --chain solana --query <symbol>
Community verification
5
onchainos token advanced-info --chain solana --address <addr>
Dev/Bundler/LP/Top10
6
onchainos swap quote --from 1111...1111 --to <token> --amount <lamports> --chain solana
Quote + Honeypot detection
7
onchainos swap swap --from <from> --to <to> --amount <amt> --chain solana --wallet <addr> --slippage <pct>
Trade execution
8
onchainos wallet addresses --chain 501
Solana address
9
onchainos wallet balance --chain 501
SOL balance
10
onchainos wallet contract-call --chain 501 --to <tx.to> --unsigned-tx <base58>
TEE signing + broadcast
11
onchainos wallet history --tx-hash <hash> --chain-index 501
Transaction confirmation

#命令用途
1
onchainos signal list --chain solana --wallet-type 1,2,3 --min-address-count 3
获取聪明钱信号
2
onchainos market prices --tokens 501:<addr1>,501:<addr2>,...
批量获取价格/市值/流动性
3
onchainos market candles --chain solana --address <addr> --bar 1m
获取蜡烛图(检测K1涨幅)
4
onchainos token search --chain solana --query <symbol>
社区验证
5
onchainos token advanced-info --chain solana --address <addr>
获取开发者/打包者/流动性池/前10持有者信息
6
onchainos swap quote --from 1111...1111 --to <token> --amount <lamports> --chain solana
获取报价 + 蜜罐检测
7
onchainos swap swap --from <from> --to <to> --amount <amt> --chain solana --wallet <addr> --slippage <pct>
执行交易
8
onchainos wallet addresses --chain 501
获取Solana地址
9
onchainos wallet balance --chain 501
获取SOL余额
10
onchainos wallet contract-call --chain 501 --to <tx.to> --unsigned-tx <base58>
TEE签名 + 广播交易
11
onchainos wallet history --tx-hash <hash> --chain-index 501
确认交易

Troubleshooting

故障排除

IssueSolution
"FATAL: onchainos CLI not found"Install onchainos and ensure it is in PATH
"No Solana address"Run
onchainos wallet login <email>
to complete login
Login expiredRe-run
onchainos wallet login <email>
Dashboard won't openCheck if port 3248 is in use:
lsof -i:3248
Bot starts but doesn't tradeCheck
PAUSED = True
, change to
False
(hot-reload, no restart needed)
Lots of SKIP in FeedSignal tokens didn't pass pre-filter (MC/Liq/soldRatio), this is normal
Lots of SAFETY_REJECT in FeedDeep verification blocked, adjust config based on rejection reason (DevRug/Bundler/K1)
No signals
keeps appearing
No smart money buy signals currently, normal behavior — just wait
Live mode buy failureCheck SOL balance >= position + 0.05; confirm wallet is logged in
InstructionError Custom:1
swap --from
must use native SOL
11111111111111111111111111111111
, not WSOL
SESSION_PAUSE, not tradingSession risk control triggered, wait for pause to end or adjust
SESSION_LOSS_LIMIT_SOL
SESSION_STOPCumulative loss reached limit, restart bot to reset session
PnL display abnormalCheck
entry_price
field in
positions.json
for value of 0
Config change not taking effectNo restart needed —
importlib.reload(config)
auto hot-reloads each cycle
问题解决方案
"FATAL: onchainos CLI not found"安装onchainos并确保其在PATH中
"No Solana address"运行
onchainos wallet login <email>
完成登录
登录过期重新运行
onchainos wallet login <email>
仪表盘无法打开检查端口3248是否被占用:
lsof -i:3248
机器人启动但不交易检查
PAUSED = True
,改为
False
(热重载,无需重启)
日志中大量SKIP信号代币未通过预过滤(市值/流动性/卖出占比),此为正常现象
日志中大量SAFETY_REJECT深度验证被阻止,根据拒绝原因(开发者跑路/打包者/K1涨幅)调整配置
持续显示
No signals
当前无聪明钱买入信号,正常现象 —— 只需等待
实盘模式买入失败检查SOL余额 >= 仓位 + 0.05;确认钱包已登录
InstructionError Custom:1
swap --from
必须使用原生SOL
11111111111111111111111111111111
,而非WSOL
SESSION_PAUSE,不交易触发会话风险控制,等待暂停结束或调整
SESSION_LOSS_LIMIT_SOL
SESSION_STOP累计损失达到限额,重启机器人重置会话
PnL显示异常检查
positions.json
中的
entry_price
字段是否为0
配置变更未生效无需重启 ——
importlib.reload(config)
每个循环自动热重载

Common Pitfalls

常见误区

IssueWrong ApproachCorrect Approach
TP not profitableTP uses raw pct
tp_threshold = pct×100 + breakeven_pct
Ignoring costsTP at 8% and sellNET 5% actual trigger = 5%+12% = 17% raw gain (low tier)
dev rugDon't check dev
onchainos token advanced-info
zero tolerance
Continuous losses without stoppingKeep trading3 consecutive losses pause / 0.10 SOL stop
swap --from uses WSOL
So11111...112
Must use native SOL
1111...1111
(32 ones)
contract-call --toPass token addressMust pass swap response's
tx.to
(DEX router address)
swap amount unitPass UI units
swap quote/swap
--amount
uses lamports (1 SOL = 1e9)
wallet balance get SOLGet WSOL balanceGet entry where
tokenAddress === ''
= native SOL

问题错误做法正确做法
止盈无盈利使用原始比例设置止盈
tp_threshold = 目标比例×100 + 盈亏平衡点比例
忽略成本设置8%止盈并卖出实际净5%触发 = 5%+12% = 17%原始涨幅(低层级)
开发者跑路风险不检查开发者信息
onchainos token advanced-info
零容忍
持续损失不停交易继续交易3次连续损失暂停 / 0.10 SOL损失停止
swap --from使用WSOL使用
So11111...112
必须使用原生SOL
1111...1111
(32个1)
contract-call --to传递代币地址必须传递swap响应中的
tx.to
(DEX路由地址)
swap金额单位使用UI单位
swap quote/swap
--amount
使用lamports(1 SOL = 1e9)
获取钱包SOL余额获取WSOL余额获取
tokenAddress === ''
的条目 = 原生SOL

Glossary

术语表

TermDefinition
Co-rider addressMultiple smart wallets buying the same token within a short time, forming a "co-riding" consensus
walletTypeSignal source type: 1=SmartMoney 2=KOL/Influencer 3=Whale
triggerWalletCountNumber of co-rider wallets; more wallets = stronger signal
soldRatioPercentSmart Money sell ratio; >80% means smart money is already exiting
breakeven_pctBreakeven point (including fees); varies by tier (7%-12%)
Cost-Aware TPTake profit threshold = NET target + breakeven_pct, ensuring actual profit after fees
Trailing StopPrice reaches activation threshold, then triggers sell when drawdown from peak exceeds threshold
Time-decay SLTime-decay stop loss — the longer the position is held, the tighter the stop loss
Trend StopTrend time stop — based on 15m candle trend reversal detection
Session RiskPer-run cumulative risk control (consecutive loss pause, cumulative loss stop)
Fail-ClosedWhen safety check API fails, treat as unsafe and do not buy
TEETrusted Execution Environment — onchainos signing happens inside a secure enclave
Agentic Walletonchainos managed wallet; private key stays inside TEE, never leaves the secure environment
DustFragment position — residual holding valued below $0.10, automatically cleaned up
Hot-reload
importlib.reload(config)
— auto-loads latest config.py parameters each cycle, no restart needed
MC / MCAPMarket Cap — token total supply × current price, measures token scale
LPLiquidity Pool — token pair pool on DEX for trading; larger LP means lower slippage
LP BurnPermanently destroying LP tokens, ensuring liquidity cannot be withdrawn by the developer
Rug PullDeveloper suddenly withdraws liquidity or dumps all holdings, causing token price to drop to zero
DevToken developer/deployer — in the meme coin context, refers to the token contract creator; their holdings and history are key risk indicators
BundlerBundle trader — addresses that buy large amounts through bundled transactions at token launch, possibly insiders or manipulators
SniperAddresses that automatically buy tokens at the instant of launch via bots; concentrated holdings may create sell pressure
HoneypotMalicious token contract that can only be bought but not sold (or has extremely high sell tax)
SlippageDifference between expected and actual execution price; worse liquidity means higher slippage
K1Most recent 1-minute candle — used to detect short-term price spikes (K1 pump), preventing buying at the top
lamportsSmallest unit of SOL, 1 SOL = 1,000,000,000 lamports
Native SOLSOL native token address
11111111111111111111111111111111
(32 ones); must use this address for swap --from
WSOLWrapped SOL (So11...112), SPL Token wrapped form of SOL; cannot be used for swap --from
术语定义
跟车地址多个聪明钱包在短时间内买入同一代币,形成“跟车”共识
walletType信号来源类型:1=聪明钱 2=KOL/网红 3=巨鲸
triggerWalletCount跟车钱包数量;钱包越多,信号越强
soldRatioPercent聪明钱卖出占比;>80%意味着聪明钱已在退出
breakeven_pct盈亏平衡点(含手续费);因层级而异(7%-12%)
Cost-Aware TP成本感知止盈 —— 止盈阈值 = 净目标收益 + 盈亏平衡点比例,确保扣除手续费后实际盈利
Trailing Stop追踪止损 —— 价格达到激活阈值后,从峰值回撤超过阈值时触发卖出
Time-decay SL时间衰减止损 —— 持仓时间越长,止损越严格
Trend Stop趋势时间止损 —— 基于15分钟蜡烛图趋势反转检测
Session Risk会话风险 —— 单次运行的累计风险控制(连续损失暂停,累计损失停止)
Fail-Closed安全检查API失败时,视为不安全,不得买入
TEE可信执行环境 —— onchainos签名在安全飞地内进行
Agentic Walletonchainos托管钱包;私钥保留在TEE内,永远不会离开安全环境
Dust小额持仓 —— 剩余持仓价值低于0.10美元,自动清理
Hot-reload热重载 ——
importlib.reload(config)
—— 每个循环自动加载最新的config.py参数,无需重启
MC / MCAP市值 —— 代币总供应量 × 当前价格,衡量代币规模
LP流动性池 —— DEX上的代币对池,用于交易;LP越大,滑点越低
LP Burn流动性池销毁 —— 永久销毁LP代币,确保开发者无法提取流动性
Rug Pull跑路 —— 开发者突然提取流动性或抛售全部持仓,导致代币价格跌至零
Dev代币开发者/部署者 —— 在迷因币语境下,指代币合约创建者;其持仓和历史是关键风险指标
Bundler打包交易者 —— 在代币发行时通过批量交易大量买入的地址,可能是内部人员或操纵者
Sniper狙击者 —— 通过机器人在代币发行瞬间自动买入的地址;集中持仓可能造成抛售压力
Honeypot蜜罐 —— 恶意代币合约,只能买入无法卖出(或卖出税极高)
Slippage滑点 —— 预期执行价格与实际执行价格的差异;流动性越差,滑点越高
K1最近1分钟蜡烛图 —— 用于检测短期价格暴涨(K1拉盘),防止在顶部买入
lamportsSOL的最小单位,1 SOL = 1,000,000,000 lamports
Native SOL原生SOL代币地址
11111111111111111111111111111111
(32个1);swap --from必须使用此地址
WSOL封装SOL(So11...112),SOL的SPL代币封装形式;不能用于swap --from