meme-trench-scanner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMeme Trench Scanner v1.0
Meme Trench Scanner v1.0
This strategy 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 for educational research and technical reference only, and do not constitute any form of investment advice, trading guidance, or financial recommendation.
- Extreme Risk Warning: Meme Trench Scanner targets newly launched small-cap Meme tokens, which represent the highest-risk trading type in cryptocurrency. Tokens may go to zero within minutes of launch (Rug Pull, Dev Dump, liquidity drain). You may lose your entire invested capital.
- Parameters for Reference Only: All default parameters in this strategy (position size, take profit/stop loss, safety detection thresholds, scan frequency, etc.) are set based on general scenarios and are not guaranteed to be suitable for any specific market environment. Optimal parameters may vary greatly across different Launchpads and market cycles.
- User Customization: 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 is annotated with comments for easy customization.
config.py - No Guarantee of Profit: Past performance does not represent future results. Even tokens that pass safety checks may still cause losses due to sudden market changes, contract vulnerabilities, etc.
- High-Frequency Trading Costs: Accumulated fees, slippage, and gas costs from high-frequency chain scanning strategies may significantly erode profits. Please fully evaluate trading costs.
- Technical Risks: On-chain transactions are irreversible. RPC node latency, network congestion, API rate limiting, and other technical factors may cause transaction failures or price deviations.
- Third-Party Dependency Risks: 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.
- Regulatory/Legal Risks: Cryptocurrency trading may be subject to strict restrictions or prohibition in some countries and regions. Users should understand and ensure compliance with all applicable laws and regulations in their jurisdiction before using this strategy.
- Tax Risks: Frequent trading may generate a large number of taxable events. Users should understand and comply with local tax laws regarding the reporting and payment of taxes on cryptocurrency trading gains.
- Assume All 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 author, developers, distributors, and their affiliates are not liable for any direct, indirect, incidental, or special losses.
Recommendation: For first-time use, please run in Paper Mode () to fully familiarize yourself with the strategy logic and parameter behavior before considering whether to switch to Live Trading.
PAPER_TRADE = True本策略脚本、参数配置及所有相关文档仅用于教育研究和技术参考,不构成任何形式的投资建议、交易指导或金融推荐。
- 极高风险警告:Meme Trench Scanner针对新上线的小市值Meme代币,这是加密货币中风险最高的交易类型。代币可能在上线几分钟内归零(Rug Pull、Dev Dump、流动性抽离),您可能损失全部投资本金。
- 参数仅作参考:本策略中的所有默认参数(持仓规模、止盈/止损、安全检测阈值、扫描频率等)基于通用场景设置,不保证适用于任何特定市场环境。不同Launchpad平台和市场周期下的最优参数可能差异极大。
- 用户自定义调整:鼓励用户深入理解每个参数的含义,并根据自身策略逻辑和风险偏好进行修改。中的每个参数都配有注释,便于自定义调整。
config.py - 无盈利保证:过往业绩不代表未来结果。即使通过安全检测的代币,仍可能因市场突变、合约漏洞等原因导致亏损。
- 高频交易成本:高频链上扫描策略产生的累计手续费、滑点和Gas成本可能大幅侵蚀利润,请充分评估交易成本。
- 技术风险:链上交易不可逆。RPC节点延迟、网络拥堵、API速率限制等技术因素可能导致交易失败或价格偏差。
- 第三方依赖风险:本策略依赖onchainos CLI、OKX API及Solana网络等第三方基础设施。其可用性、准确性和稳定性不受策略作者控制。这些服务的任何变更、中断或故障都可能导致策略失效或产生意外损失。
- 监管/法律风险:加密货币交易在部分国家和地区可能受到严格限制或禁止。用户在使用本策略前应了解并确保遵守所在司法辖区的所有适用法律法规。
- 税务风险:频繁交易可能产生大量应税事件。用户应了解并遵守当地关于加密货币交易收益申报和缴税的税法规定。
- 自行承担全部责任:本策略按"原样"提供,不提供任何明示或暗示的担保。使用本策略做出的所有交易决策及其后果由用户自行承担。策略作者、开发者、分销商及其关联方不对任何直接、间接、偶然或特殊损失负责。
建议:首次使用时,请在模拟交易模式()中运行,充分熟悉策略逻辑和参数行为后,再考虑是否切换至实盘交易。
PAPER_TRADE = TrueFile Structure
文件结构
Meme Trench Scanner - Meme 扫链/
├── skill.md ← This file (strategy documentation)
├── config.py ← All adjustable parameters (modify parameters here only)
├── scan_live.py ← Strategy main program
├── dashboard.html ← Web Dashboard UI
├── scan_positions.json ← [Auto-generated] Position data
├── scan_trades.json ← [Auto-generated] Trade history
├── trader_soul.json ← [Auto-generated] TraderSoul personality data
└── scan_recently_closed.json ← [Auto-generated] Cooldown recordsMeme Trench Scanner - Meme 扫链/
├── skill.md ← This file (strategy documentation)
├── config.py ← All adjustable parameters (modify parameters here only)
├── scan_live.py ← Strategy main program
├── dashboard.html ← Web Dashboard UI
├── scan_positions.json ← [Auto-generated] Position data
├── scan_trades.json ← [Auto-generated] Trade history
├── trader_soul.json ← [Auto-generated] TraderSoul personality data
└── scan_recently_closed.json ← [Auto-generated] Cooldown recordsPrerequisites
前置条件
1. Install onchainos CLI (>= 2.1.0)
1. 安装onchainos CLI(版本≥2.1.0)
bash
undefinedbash
undefinedCheck if already installed
Check if already installed
onchainos --version
onchainos --version
If not installed, follow the onchainos official documentation
If not installed, follow the onchainos official documentation
Ensure onchainos is in PATH or located at ~/.local/bin/onchainos
Ensure onchainos is in PATH or located at ~/.local/bin/onchainos
undefinedundefined2. Log in to Agentic Wallet (TEE Signing)
2. 登录Agentic Wallet(TEE签名)
bash
undefinedbash
undefinedOne-time login (email verification)
One-time login (email verification)
onchainos wallet login <your-email>
onchainos wallet login <your-email>
Verify login status
Verify login status
onchainos wallet status
onchainos wallet status
→ loggedIn: true
→ loggedIn: true
Confirm Solana address
Confirm Solana address
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 WALLET_PRIVATE_KEY environment variable.onchainos wallet addresses --chain 501
> Agentic Wallet采用TEE安全飞地签名;私钥绝不会暴露给代码/日志/网络。
> 无需设置WALLET_PRIVATE_KEY环境变量。3. No pip install needed
3. 无需pip安装依赖
This strategy only depends on Python standard library + onchainos CLI, no third-party packages required.
本策略仅依赖Python标准库 + onchainos CLI,无需安装第三方包。
AI Agent Startup Interaction Protocol
AI Agent启动交互协议
When the user requests to start this strategy, the AI Agent must follow the procedure below and must not skip directly to startup.
当用户请求启动本策略时,AI Agent必须遵循以下流程,不得直接跳过启动前步骤。
Phase 1: Display Strategy Overview
阶段1:展示策略概述
Show the user the following content:
🔍 Meme Trench Scanner v1.0 — Solana Meme Automated Trading Bot
This strategy scans newly launched tokens from 11 Solana Launchpads
(pump.fun, Believe, LetsBonk, etc.) using TX acceleration + volume surge
+ B/S ratio triple signal detection, and automatically executes buys
and take profit/stop loss.
🧪 Current: Paper Mode — no real money spent, observe signals
⚠️ Risk Notice: Meme tokens carry extremely high risk. You may lose your entire invested capital.
Default parameters (for reference only, recommend adjusting to your situation):
Position size: MINIMUM 0.15 SOL / STRONG 0.25 SOL
Max exposure: 1.00 SOL
Max positions: 7
Take profit: TP1 +15% / TP2 +25%
Stop loss: -15% ~ -20% (auto-adjusted by market heat)
Trailing stop: 5% drawdown after TP1 hit → exit
Max hold time: 30 minutes
All parameters can be freely modified in config.py to suit your trading style.向用户展示以下内容:
🔍 Meme Trench Scanner v1.0 — Solana Meme自动化交易机器人
本策略通过交易加速+成交量激增+买卖比三重信号检测,扫描11个Solana Launchpad平台
(pump.fun、Believe、LetsBonk等)上新上线的代币,并自动执行买入、止盈/止损操作。
🧪 当前状态:模拟交易模式 — 不使用真实资金,仅观察信号
⚠️ 风险提示:Meme代币风险极高,您可能损失全部投资本金。
默认参数(仅作参考,建议根据自身情况调整):
持仓规模: 最小0.15 SOL / 激进0.25 SOL
最大暴露额度:1.00 SOL
最大持仓数: 7
止盈设置: TP1 +15% / TP2 +25%
止损设置: -15% ~ -20%(根据市场热度自动调整)
追踪止损: 触发TP1后回撤5% → 平仓
最长持仓时间:30分钟
所有参数可在config.py中自由修改,以适配您的交易风格。Q1: Risk Preference (Required)
Q1:风险偏好(必填)
- 🛡️ Conservative: Quick in-and-out, small take profit, strict stop loss
- ⚖️ Default: Balanced configuration (recommended)
- 🔥 Aggressive: Large take profit, wide stop loss
→ Parameter mapping (for AI Agent to write to config.py, no need to show to user):
| Preference | TP1_PCT | TP2_PCT | S1_PCT (SCALP/hot/quiet) | MAX_HOLD_MIN | MAX_POSITIONS | TRAILING_DROP |
|---|---|---|---|---|---|---|
| Conservative | 0.10 | 0.18 | -0.12 / -0.15 / -0.15 | 20 | 5 | 0.03 |
| Default | 0.15 | 0.25 | -0.15 / -0.20 / -0.20 | 30 | 7 | 0.05 |
| Aggressive | 0.25 | 0.40 | -0.25 / -0.30 / -0.30 | 45 | 10 | 0.08 |
Note: S1_PCT is automatically split into three tiers by market heat (SCALP=rapid/hot=active/quiet=calm), no user selection needed.
- 🛡️ 保守型:快进快出,小止盈,严格止损
- ⚖️ 默认型:均衡配置(推荐)
- 🔥 激进型:大止盈,宽止损
→ 参数映射(AI Agent写入config.py,无需展示给用户):
| 风险偏好 | TP1_PCT | TP2_PCT | S1_PCT(SCALP/热门/平静) | MAX_HOLD_MIN | MAX_POSITIONS | TRAILING_DROP |
|---|---|---|---|---|---|---|
| 保守型 | 0.10 | 0.18 | -0.12 / -0.15 / -0.15 | 20 | 5 | 0.03 |
| 默认型 | 0.15 | 0.25 | -0.15 / -0.20 / -0.20 | 30 | 7 | 0.05 |
| 激进型 | 0.25 | 0.40 | -0.25 / -0.30 / -0.30 | 45 | 10 | 0.08 |
注:S1_PCT会根据市场热度自动分为三个等级(SCALP=快速波动/热门=活跃/平静=低迷),无需用户选择。
Q2: Switch to Live Trading?
Q2:切换至实盘交易?
- A. 🧪 Stay in Paper Mode, start directly (recommended default)
- B. 💰 Switch to Live Trading mode
Choose A → Proceed directly to startup steps.
Choose B → Enter Live Trading sub-flow:
-
⚠️ Confirm with user: "Live Trading will use real SOL. Losses are irreversible. Confirm switch to Live Trading?"
- User confirms → Continue
- User declines → Fall back to Paper Mode
-
Ask for max exposure in SOL (default 1.00 SOL)
-
AI auto-calculates (let M = user's input exposure):
MAX_SOL = M- :
SOL_PER_TRADE- [disabled in current version]
SCALP: max(M × 0.25, 0.05) MINIMUM: max(M × 0.15, 0.05)STRONG: max(M × 0.25, 0.05)
- (cumulative loss pause line)
PAUSE_LOSS_SOL = M × 0.30 - (cumulative loss stop line)
STOP_LOSS_SOL = M × 0.50
-
Show calculation results to user and confirm: "Your Live Trading config: Max exposure X SOL, per-trade MINIMUM/STRONG = Y/Y SOL, loss pause Z SOL / stop W SOL. Confirm?"
- User confirms → Write to config.py
- User requests adjustment → Return to step 2
-
Set mode parameters:
PAPER_TRADE = FalsePAUSED = False
- A. 🧪 保持模拟交易模式,直接启动(推荐默认选项)
- B. 💰 切换至实盘交易模式
选择A → 直接进入启动步骤。
选择B → 进入实盘交易子流程:
-
⚠️ 向用户确认: "实盘交易将使用真实SOL,损失不可逆。确认切换至实盘交易模式?"
- 用户确认 → 继续
- 用户拒绝 → 退回模拟交易模式
-
询问用户SOL最大暴露额度(默认1.00 SOL)
-
AI自动计算(令M为用户输入的暴露额度):
MAX_SOL = M- :
SOL_PER_TRADE- [当前版本已禁用]
SCALP: max(M × 0.25, 0.05) MINIMUM: max(M × 0.15, 0.05)STRONG: max(M × 0.25, 0.05)
- (累计亏损暂停线)
PAUSE_LOSS_SOL = M × 0.30 - (累计亏损停止线)
STOP_LOSS_SOL = M × 0.50
-
向用户展示计算结果并确认: "您的实盘交易配置:最大暴露额度X SOL,单笔交易最小/激进额度=Y/Y SOL,亏损暂停Z SOL / 停止W SOL。确认?"
- 用户确认 → 写入config.py
- 用户要求调整 → 返回步骤2
-
设置模式参数:
PAPER_TRADE = FalsePAUSED = False
Startup
启动步骤
- Modify corresponding parameters in based on user responses
config.py - Set (allow bot to run normally after interactive confirmation)
PAUSED = False - Check prerequisites: ,
onchainos --versiononchainos wallet status - Start bot:
python3 scan_live.py - Show Dashboard link:
http://localhost:3241 - Inform user: Currently in Paper Mode. To switch to Live Trading, modify in
PAPER_TRADE = Falseconfig.py
If the user says "use default config" or "just run it", only set , leave everything else unchanged, and start directly in Paper Mode.
PAUSED = False- 根据用户回复修改中的对应参数
config.py - 设置(交互确认后允许机器人正常运行)
PAUSED = False - 检查前置条件:、
onchainos --versiononchainos wallet status - 启动机器人:
python3 scan_live.py - 展示仪表盘链接:
http://localhost:3241 - 告知用户:当前处于模拟交易模式。如需切换至实盘交易,修改中的
config.pyPAPER_TRADE = False
如果用户说"使用默认配置"或"直接运行",仅设置,其余参数保持不变,直接以模拟交易模式启动。
PAUSED = FalseSpecial Cases
特殊情况
- User explicitly says "don't ask me, just run" → Start with default parameters (Paper Mode), but must show Phase 1 overview + set
PAUSED = False - User is a returning user (configuration history exists in conversation) → Remind of previous configuration, ask whether to reuse
- 用户明确表示"别问了,直接运行" → 使用默认参数启动(模拟交易模式),但必须展示阶段1的概述内容 + 设置
PAUSED = False - 用户为回头客(对话中存在配置历史) → 提醒之前的配置,询问是否复用
Quick Start
快速开始
⚠️ Before starting, confirm thevalue in config.py —PAPER_TRADEfor Paper Trading,Truefor Live Trading.False
bash
cd ~/CC/Meme\ Trench\ Scanner\ -\ Meme\ 扫链⚠️ 启动前,请确认config.py中的值 —PAPER_TRADE为模拟交易,True为实盘交易。False
bash
cd ~/CC/Meme\ Trench\ Scanner\ -\ Meme\ 扫链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 scan_live.py
python3 scan_live.py
Or run in background
或后台运行
nohup python3 scan_live.py > bot.log 2>&1 &
nohup python3 scan_live.py > bot.log 2>&1 &
3. Open Dashboard
3. 打开仪表盘
4. Stop
4. 停止机器人
pkill -f scan_live.py
> **First startup defaults to PAUSED=True, will not open new positions. After confirming everything is normal, modify config.py PAUSED=False.**
---pkill -f scan_live.py
> **首次启动默认设置为PAUSED=True,不会开新仓。确认一切正常后,修改config.py中的PAUSED=False。**
---Parameter Adjustment
参数调整
All adjustable parameters are in , no need to modify .
config.pyscan_live.py所有可调整参数均在中,无需修改。
config.pyscan_live.pyCommon Adjustments
常见调整项
| Need | Modify in |
|---|---|
| Pause/resume trading | |
| Adjust position size | |
| Adjust max exposure | |
| Adjust max positions | |
| Adjust take profit | |
| Adjust stop loss | |
| Adjust scan speed | |
| MC range | |
| Paper Trading | |
| Limit total trades | |
| Dashboard port | |
Restart bot for changes to take effect.
config.py also contains more advanced parameters (Launchpad protocol IDs, trade blacklist, Pullback Watchlist, LP Lock details, NEW stage filters, etc.). See comments in config.py for details.
| 需求 | 在 |
|---|---|
| 暂停/恢复交易 | |
| 调整持仓规模 | |
| 调整最大暴露额度 | |
| 调整最大持仓数 | |
| 调整止盈设置 | |
| 调整止损设置 | |
| 调整扫描速度 | |
| 市值范围 | |
| 模拟交易 | |
| 限制总交易次数 | |
| 仪表盘端口 | |
修改后重启机器人生效。
config.py中还包含更多高级参数(Launchpad协议ID、交易黑名单、回调观察列表、LP锁定详情、NEW阶段过滤器等)。详见config.py中的注释。
Strategy Architecture
策略架构
scan_live.py (single-file Bot)
├── onchainos CLI (data + execution + safety — no API Key)
├── scanner_loop() ← background thread, every 10s
│ ├── memepump_token_list() Token discovery (11 Launchpads)
│ ├── pre_filter() Basic filters (MC/Age/B&S/Vol/Holders)
│ ├── hot_mode_check() Market heat detection
│ └── detect_signal() Signal detection
│ ├── 5m/15m B/S (raw trades calculation)
│ ├── TX acceleration detection (Signal A)
│ ├── Volume surge (Signal B)
│ ├── Anti-chase protection
│ ├── TOP_ZONE 85% filter
│ ├── Confidence scoring
│ └── → try_open_position() (async thread)
│ └── deep_safety_check() (Dev+Bundle+LP+Aped)
├── monitor_loop() ← background thread, every 1s
│ ├── _quick_wallet_sync() Wallet sync
│ ├── check_position() Exit decision
│ │ ├── HE1: -50% emergency exit
│ │ ├── FAST_DUMP: -15% within 10s
│ │ ├── S1: Stop loss / Breakeven
│ │ ├── S3: Time stop
│ │ ├── Trailing: 5% drawdown after TP1
│ │ ├── TP1: +15% partial sell
│ │ └── TP2: +25% full exit
│ └── wallet_audit() Periodic reconciliation
├── TraderSoul AI personality (observe only, no param changes)
├── Dashboard (port 3241) Web UI
└── Persistent files (JSON, atomic write)scan_live.py (single-file Bot)
├── onchainos CLI (data + execution + safety — no API Key)
├── scanner_loop() ← background thread, every 10s
│ ├── memepump_token_list() Token discovery (11 Launchpads)
│ ├── pre_filter() Basic filters (MC/Age/B&S/Vol/Holders)
│ ├── hot_mode_check() Market heat detection
│ └── detect_signal() Signal detection
│ ├── 5m/15m B/S (raw trades calculation)
│ ├── TX acceleration detection (Signal A)
│ ├── Volume surge (Signal B)
│ ├── Anti-chase protection
│ ├── TOP_ZONE 85% filter
│ ├── Confidence scoring
│ └── → try_open_position() (async thread)
│ └── deep_safety_check() (Dev+Bundle+LP+Aped)
├── monitor_loop() ← background thread, every 1s
│ ├── _quick_wallet_sync() Wallet sync
│ ├── check_position() Exit decision
│ │ ├── HE1: -50% emergency exit
│ │ ├── FAST_DUMP: -15% within 10s
│ │ ├── S1: Stop loss / Breakeven
│ │ ├── S3: Time stop
│ │ ├── Trailing: 5% drawdown after TP1
│ │ ├── TP1: +15% partial sell
│ │ └── TP2: +25% full exit
│ └── wallet_audit() Periodic reconciliation
├── TraderSoul AI personality (observe only, no param changes)
├── Dashboard (port 3241) Web UI
└── Persistent files (JSON, atomic write)Signal Tiers
信号等级
| Tier | Conditions | Position |
|---|---|---|
| SCALP | sig_a + sig_c | 0.25 SOL (currently disabled) |
| MINIMUM | sig_a + sig_c (no sig_b) | 0.15 SOL |
| STRONG | sig_a + sig_b + sig_c | 0.25 SOL |
In the current version, SCALP signals are skipped; only MINIMUM and STRONG execute trades.
| 等级 | 触发条件 | 持仓规模 |
|---|---|---|
| SCALP | sig_a + sig_c | 0.25 SOL(当前版本已禁用) |
| MINIMUM | sig_a + sig_c(无sig_b) | 0.15 SOL |
| STRONG | sig_a + sig_b + sig_c | 0.25 SOL |
当前版本中SCALP信号会被跳过;仅MINIMUM和STRONG信号会执行交易。
Safety Detection
安全检测
Server-Side Filtering (memepump tokens parameters)
服务器端过滤(memepump代币参数)
| Check | Threshold |
|---|---|
| MC range | $50K - $800K |
| Holders | >= 50 |
| Bundler holdings | <= 15% |
| Dev holdings | <= 10% |
| Insider | <= 15% |
| Sniper | <= 20% |
| Top 10 holdings | <= 40% |
| Fresh wallets | <= 40% |
| 检测项 | 阈值 |
|---|---|
| 市值范围 | $50K - $800K |
| 持币地址数 | ≥ 50 |
| Bundler持仓占比 | ≤ 15% |
| 开发者持仓占比 | ≤ 10% |
| 内幕账户持仓占比 | ≤ 15% |
| 狙击机器人持仓占比 | ≤ 20% |
| 前10大持仓占比 | ≤ 40% |
| 新钱包持仓占比 | ≤ 40% |
Deep Safety (deep_safety_check)
深度安全检测(deep_safety_check)
| Check | Threshold |
|---|---|
| Dev rug count | = 0 (zero tolerance) |
| Dev rug rate | <= 50% |
| Dev holdings | <= 10% |
| Dev historical launches | <= 800 |
| Bundler ATH | <= 25% |
| Bundler count | <= 30 |
| Aped wallets | <= 10 |
| LP Lock | >= 80% |
| Serial Rugger | death rate <= 60% |
| 检测项 | 阈值 |
|---|---|
| 开发者跑路次数 | = 0(零容忍) |
| 开发者跑路率 | ≤ 50% |
| 开发者持仓占比 | ≤ 10% |
| 开发者历史上线代币数 | ≤ 800 |
| Bundler历史最高持仓占比 | ≤ 25% |
| Bundler数量 | ≤ 30 |
| 大额早期持仓钱包数 | ≤ 10 |
| LP锁定比例 | ≥ 80% |
| 惯犯跑路者 | 代币死亡率 ≤ 60% |
7-Layer Exit System
七层平仓系统
| Priority | Exit Type | Trigger Condition | Sell Ratio |
|---|---|---|---|
| HE1 | Emergency exit | PnL <= -50% | 100% |
| FAST_DUMP | Crash detection | >= 15% drop within 10s | 100% |
| S1 | Stop loss | PnL <= -15%~-20% (by market heat) | 100% |
| S3 | Time stop | SCALP 5min / hot 8min / quiet 15min still losing | 100% |
| Trailing | Trailing stop | >= 5% drawdown from peak after TP1 hit | 100% |
| TP1 | First take profit | +15% | 40-50% |
| TP2 | Second take profit | +25% | 100% |
Priority is top to bottom; once triggered, executes immediately without checking subsequent layers.
| 优先级 | 平仓类型 | 触发条件 | 卖出比例 |
|---|---|---|---|
| HE1 | 紧急平仓 | 盈亏比 ≤ -50% | 100% |
| FAST_DUMP | 暴跌检测 | 10秒内跌幅≥15% | 100% |
| S1 | 止损平仓 | 盈亏比 ≤ -15%~-20%(根据市场热度) | 100% |
| S3 | 时间止损 | SCALP持仓5分钟/热门市场8分钟/平静市场15分钟仍亏损 | 100% |
| 追踪止损 | 追踪平仓 | 触发TP1后从峰值回撤≥5% | 100% |
| TP1 | 首次止盈 | 盈利+15% | 40-50% |
| TP2 | 二次止盈 | 盈利+25% | 100% |
优先级从上到下;一旦触发,立即执行,不再检查后续层级。
Session Risk Control
会话风险控制
| Rule | Value |
|---|---|
| Consecutive loss pause | 2 losses → pause 15min |
| Cumulative loss pause | >= 0.30 SOL → pause 30min |
| Cumulative loss stop | >= 0.50 SOL → stop trading |
| Max hold time | 30min |
| HKT sleep | 04:00-08:00 no new positions |
| MAX_TRADES | Auto-stop after 50 trades |
| 规则 | 数值 |
|---|---|
| 连续亏损暂停 | 2次亏损 → 暂停15分钟 |
| 累计亏损暂停 | ≥ 0.30 SOL → 暂停30分钟 |
| 累计亏损停止 | ≥ 0.50 SOL → 停止交易 |
| 最长持仓时间 | 30分钟 |
| 香港时间休眠 | 04:00-08:00不新开仓 |
| 最大交易次数 | 完成50笔交易后自动停止 |
Iron Rules (Must Not Be Violated)
铁则(严禁违反)
- NEVER delete a position based on a single balance check. Must have .
zero_balance_count >= 3 - NEVER call outside of
save_positions().pos_lock - When returns TIMEOUT, always create an
tx_status()position.unconfirmed=True - RPC balance 0 ≠ token does not exist (Solana RPC has significant latency).
- 严禁仅通过单次余额检查就删除持仓。必须满足。
zero_balance_count >= 3 - 严禁在外部调用
pos_lock。save_positions() - 当返回TIMEOUT时,必须创建一个
tx_status()的持仓记录。unconfirmed=True - RPC余额为0 ≠ 代币不存在(Solana RPC存在显著延迟)。
onchainos CLI Command Reference
onchainos CLI命令参考
| # | Command | Purpose |
|---|---|---|
| 1 | | Token discovery |
| 2 | | Token details |
| 3 | | Dev safety |
| 4 | | Bundler |
| 5 | | Aped wallets |
| 6 | | Similar tokens |
| 7 | | Real-time price |
| 8 | | K-line |
| 9 | | Trade history |
| 10 | | Quote |
| 11 | | Build transaction |
| 12 | | TEE sign + broadcast |
| 13 | | Transaction confirmation |
| 14 | | Login status |
| 15 | | Solana address |
| 16 | | All balances |
| 17 | | Single token balance |
| 序号 | 命令 | 用途 |
|---|---|---|
| 1 | | 代币发现 |
| 2 | | 代币详情 |
| 3 | | 开发者安全检测 |
| 4 | | Bundler信息 |
| 5 | | 大额早期持仓钱包 |
| 6 | | 相似代币 |
| 7 | | 实时价格 |
| 8 | | K线数据 |
| 9 | | 交易历史 |
| 10 | | 报价查询 |
| 11 | | 构建交易 |
| 12 | | TEE签名+广播 |
| 13 | | 交易确认 |
| 14 | | 登录状态 |
| 15 | | Solana地址查询 |
| 16 | | 全资产余额 |
| 17 | | 单代币余额 |
Troubleshooting
故障排查
| Problem | Solution |
|---|---|
| "FATAL: onchainos CLI not found" | Install onchainos and ensure it is on PATH |
| "FATAL: Agentic Wallet not logged in" | Run |
| "FATAL: Unable to parse Solana address" | Check |
| Dashboard won't open | Check if port 3241 is in use: |
| Bot not trading | Check config.py |
| Transaction failed InstructionError | swap --from must use |
| Login expired | Re-run |
| 问题 | 解决方案 |
|---|---|
| "FATAL: onchainos CLI not found" | 安装onchainos并确保其在PATH中 |
| "FATAL: Agentic Wallet not logged in" | 运行 |
| "FATAL: Unable to parse Solana address" | 检查 |
| 仪表盘无法打开 | 检查端口3241是否被占用: |
| 机器人不执行交易 | 检查config.py中的 |
| 交易失败出现InstructionError | swap --from必须使用 |
| 登录过期 | 重新运行 |
Glossary
术语表
| Term | Definition |
|---|---|
| SCALP / hot / quiet | Three market heat tiers — SCALP=rapid, hot=active, quiet=calm; auto-detected, affects stop loss and position size |
| Signal A (TX Acceleration) | Transaction frequency surge detection — triggers when current txs/min exceeds baseline x threshold |
| Signal B (Volume Surge) | 5m/15m volume breakout detection |
| Signal C (B/S Ratio) | Buy/sell ratio confirmation — buy count / sell count > threshold |
| Confidence | Signal confidence score (0-100), calculated from Signal A/B/C combined |
| TOP_ZONE | Price position filter — current price's position within historical range, >85% means near ATH, skip |
| FAST_DUMP | 10-second crash detection — 15% drop within 10s triggers emergency exit |
| deep_safety_check | Deep safety check — Dev rug history, Bundler holdings, LP Lock, Aped wallets, etc. |
| Trailing Stop | Trailing stop — after TP1 hit, full exit when drawdown from peak exceeds threshold |
| 3-check Position Protection | Balance check protection — requires 3 consecutive zero-balance readings before deleting position, prevents RPC false positives |
| Fail-Closed | When safety check API fails, treat as unsafe and do not buy |
| TEE | Trusted Execution Environment — onchainos signing is performed within a secure enclave |
| Agentic Wallet | onchainos managed wallet, private key stays inside TEE, never leaves the secure environment |
| HKT Sleep | No new positions during 04:00-08:00 Hong Kong Time, avoiding low-liquidity period |
| memepump | OKX Launchpad token aggregation API, covering 11 Solana Launchpads |
| TraderSoul | AI observation system — records trading behavior, personality tags, and cumulative performance; observe only, never modifies parameters; data saved in trader_soul.json |
| Launchpad | Token launch platform — pump.fun, Believe, LetsBonk, etc.; new tokens debut here and establish initial liquidity |
| MC / MCAP | Market Cap — token total supply x current price, measures token scale |
| LP | Liquidity Pool — token pair liquidity pool on DEX; larger LP means lower buy/sell slippage |
| LP Lock | Locking LP tokens for a period to ensure liquidity cannot be pulled by developers in the short term |
| Rug Pull | Malicious act where developers suddenly withdraw liquidity or dump all holdings, causing token price to go to zero |
| Dev | Token developer/deployer — in the Meme token context, refers to the creator of the token contract; their holdings and historical behavior are important risk indicators |
| Bundler | Bundle trader — addresses that buy large amounts through bundled transactions at token launch; may be insiders or manipulators |
| Sniper | Sniper — bot addresses that automatically buy at the instant of token launch; concentrated holdings may create sell pressure |
| Aped Wallet | Wallets that bought large amounts early in a token's life; too many indicates the token is being targeted by bots |
| Honeypot | Malicious token contract where you can buy but cannot sell (or sell tax is extremely high) |
| Slippage | Difference between expected and actual execution price; worse liquidity means higher slippage |
| 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 |
| 术语 | 定义 |
|---|---|
| SCALP / hot / quiet | 三种市场热度等级——SCALP=快速波动、hot=活跃、quiet=平静;自动检测,会影响止损和持仓规模 |
| Signal A (TX Acceleration) | 交易频率激增检测——当当前每分钟交易数超过基准值×阈值时触发 |
| Signal B (Volume Surge) | 5分钟/15分钟成交量突破检测 |
| Signal C (B/S Ratio) | 买卖比确认——买入次数/卖出次数 > 阈值 |
| Confidence | 信号置信度评分(0-100),由Signal A/B/C组合计算得出 |
| TOP_ZONE | 价格位置过滤——当前价格在历史区间中的位置,>85%意味着接近历史最高价,将跳过该代币 |
| FAST_DUMP | 10秒暴跌检测——10秒内跌幅达15%时触发紧急平仓 |
| deep_safety_check | 深度安全检测——包括开发者跑路历史、Bundler持仓、LP锁定、大额早期持仓钱包等 |
| Trailing Stop | 追踪止损——触发TP1后,从峰值回撤超过阈值时全额平仓 |
| 3-check Position Protection | 三重校验持仓保护——需要连续3次读取到零余额才删除持仓,防止RPC误报 |
| Fail-Closed | 当安全检测API失败时,视为代币不安全,不执行买入 |
| TEE | 可信执行环境(Trusted Execution Environment)——onchainos签名在安全飞地内执行 |
| Agentic Wallet | onchainos托管钱包,私钥存储在TEE内,绝不会离开安全环境 |
| HKT Sleep | 香港时间04:00-08:00不新开仓,避开低流动性时段 |
| memepump | OKX Launchpad代币聚合API,覆盖11个Solana Launchpad平台 |
| TraderSoul | AI观察系统——记录交易行为、个性标签和累计业绩;仅作观察,绝不修改参数;数据存储在trader_soul.json中 |
| Launchpad | 代币上线平台——如pump.fun、Believe、LetsBonk等;新代币在此首发并建立初始流动性 |
| MC / MCAP | 市值(Market Cap)——代币总供应量×当前价格,衡量代币规模 |
| LP | 流动性池(Liquidity Pool)——DEX上的代币对流动性池;LP越大,买卖滑点越低 |
| LP Lock | 锁定LP代币一段时间,确保短期内开发者无法抽离流动性 |
| Rug Pull | 恶意行为——开发者突然抽离流动性或抛售全部持仓,导致代币价格归零 |
| Dev | 代币开发者/部署者——在Meme代币语境下,指代币合约的创建者;其持仓和历史行为是重要风险指标 |
| Bundler | 批量交易者——在代币上线时通过批量交易大量买入的地址;可能是内幕人员或操纵者 |
| Sniper | 狙击机器人——在代币上线瞬间自动买入的机器人地址;集中持仓可能带来抛售压力 |
| Aped Wallet | 大额早期持仓钱包——在代币生命周期早期大量买入的钱包;数量过多意味着代币被机器人盯上 |
| Honeypot | 恶意代币合约——只能买入无法卖出(或卖出税极高) |
| Slippage | 预期执行价格与实际执行价格的差异;流动性越差,滑点越高 |
| lamports | SOL的最小单位,1 SOL = 1,000,000,000 lamports |
| Native SOL | SOL原生代币地址 |
| WSOL | 封装SOL(So11...112),SOL的SPL代币封装形式,不能用于swap --from |