Lets Web3 beginners practice trading with zero real money at risk, using live on-chain data from the onchainos CLI. Every simulated trade is scored across five dimensions so users learn why good trades work.
Prerequisites
Requires the onchainos CLI (same as web3-safe-guide):
curl -sSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh
Core Principles
- Real data, zero risk: All prices and market data come from live onchainos calls — the simulation is realistic, but no wallet is touched.
- Score every decision: After each trade, give an objective score so users learn, not just play.
- State lives in conversation: The virtual portfolio is maintained as a running ledger in the conversation. Be explicit when the user's session ends ("your virtual portfolio will reset if we start a new chat").
- Education woven in: Explain why a score is what it is. Never just say "bad trade" — say which factor dragged the score.
- Safety gate still applies: Honeypot tokens are blocked even in simulation. No point teaching bad habits.
Virtual Portfolio State
The portfolio is persisted locally so it survives across conversations.
Storage
- File:
~/.web3-trade-simulator/portfolio.json - On skill start: Read the file if it exists and resume from saved state. If the file is missing, initialize a fresh $10,000 portfolio and create the file.
- After every trade action (buy, sell, reset): Write the full updated state back to the file immediately.
JSON Schema
{
"cash": 10000.00,
"positions": [
{
"symbol": "BONK",
"address": "0x...",
"chain": "501",
"entryPrice": 0.00002341,
"qty": 42700000,
"entryTimestamp": "2025-01-15T10:23:00Z",
"decisionScore": 72
}
],
"closedTrades": [
{
"symbol": "WIF",
"entryPrice": 2.15,
"exitPrice": 2.89,
"qty": 465,
"entryTimestamp": "2025-01-10T08:00:00Z",
"exitTimestamp": "2025-01-12T14:30:00Z",
"pnlPercent": 34.4,
"pnlUsd": 344.10,
"decisionScore": 68,
"exitScore": 12
}
],
"avgDecisionScore": 70.0
}
Ledger Display
=== 🎮 Virtual Portfolio ===
Starting balance: $10,000 USDC (virtual)
Current cash: $XXX.XX
Open positions:
- [SYMBOL] | Entry: $X.XXXX | Qty: XXXX | Value now: $XX.XX | P&L: [+/-]X%
Closed trades: [N] trades
Total P&L: [+/-]$XX.XX ([+/-]X%)
Trading Score: [X]/100
Display this ledger at the start of every response when the user has at least one open or closed position.
Trade Decision Score (0–100)
Score each entry decision across five dimensions. Show breakdown after every simulated buy.
| Dimension | Weight | How to Compute |
|---|---|---|
| Safety | 30 pts | Use full Safety Score from web3-safe-guide workflow. Map 0–100 → 0–30 pts linearly. |
| Smart Money Alignment | 20 pts | Run signal check (below). Signal present + still holding: +20; signal faded/none: +0; signal already fully exited: −10. |
| Trend Timing | 20 pts | Analyze last-12-candle kline. Buying into uptrend: +20; sideways: +10; buying into downtrend: +0. |
| Liquidity Discipline | 15 pts | liquidity from price-info. >$1M: +15; $100K–$1M: +10; $10K–$100K: +5; <$10K: −15. |
| Position Sizing | 15 pts | Evaluate the virtual amount vs current balance. ≤10% of balance: +15; 11–25%: +10; 26–50%: +5; >50%: −15. |
Score Levels:
85–100 🏆 Expert — Disciplined, well-researched entry
65–84 🟢 Good — Solid decision with minor gaps
45–64 🟡 Average — Some good instincts, needs work on [weakest dimension]
25–44 🟠 Risky — Significant red flags ignored
0–24 🔴 Dangerous — This trade pattern leads to large losses
Workflow 1 — Simulate a Buy
Triggers: "simulated buy", "suppose I bought X", "paper buy X", "simulate buying X"
Steps
# 1. Find and validate token (same as web3-safe-guide Workflow 1)
onchainos token search <name> --chains "1,501,8453,56,42161"
# 2. Full safety check
onchainos token price-info <address> --chain <chain>
onchainos token holders <address> --chain <chain>
onchainos swap quote \
--from 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee \
--to <address> \
--amount 1000000000000000000 \
--chain <chain>
# → isHoneyPot check — block if true
# 3. Get simulated entry quote (the "buy price")
onchainos swap quote \
--from <native_or_usdc_address> \
--to <tokenAddress> \
--amount <virtual_amount_in_minimal_units> \
--chain <chain>
# → toTokenAmount (how many tokens user would get), priceImpactPercent
# 4. Trend at entry
onchainos market kline <address> --chain <chain> --bar 1H --limit 12
# → classify uptrend / downtrend / sideways
# 5. Smart money signal check
onchainos market signal-list <chain> --wallet-type "1,2,3" --min-amount-usd 500
# → find if this token appears in recent signals + soldRatioPercent
Block Conditions
isHoneyPot = true→ "☠️ Even in paper trading, scam tokens have no place in our training. Let me show you a token that's actually worth researching."- Safety Score < 30 → Warn strongly but allow if user confirms ("This score is very low; in real trading you would most likely lose money. Continue the simulation?")
Output Template
## 🎮 模拟买入确认
已记录!这是你的虚拟持仓:
**[SYMBOL]** — 模拟买入
- 买入价格:$X.XXXX
- 买入数量:XX,XXX [SYMBOL](虚拟投入 $XXX)
- 占总资金:XX%
---
### 📊 入场决策评分:[N]/100 [emoji]
| 维度 | 得分 | 说明 |
|---|---|---|
| 安全评分 | X/30 | Safety Score [N]/100 — [简评] |
| 聪明钱对齐 | X/20 | [有信号且持有中 / 信号已消退 / 无信号] |
| 趋势时机 | X/20 | [顺势 / 横盘 / 逆势买入] |
| 流动性纪律 | X/15 | 流动性 $XXM — [评价] |
| 仓位管理 | X/15 | 占资金 X% — [合理 / 偏重] |
**[Score Level 评价]**
[1–2句话解释最拖分的维度,教用户下次怎么改]
---
[更新后的虚拟持仓总览]
下一步:
1. 追踪这个仓位的实时盈亏
2. 再模拟一笔交易
3. 查看完整交易评分报告
Workflow 2 — Check Portfolio & Live P&L
Triggers: "my positions", "simulated profit and loss", "portfolio", "how am I doing", "view holdings"
Steps
# For each open position, fetch current price
onchainos token price-info <address> --chain <chain>
# → current price; compute P&L = (current - entry) / entry × 100%
# Also fetch short kline to show momentum
onchainos market kline <address> --chain <chain> --bar 1H --limit 6
# → is position gaining or losing momentum?
Output Template
## 🎮 虚拟投资组合实时更新
💰 虚拟资金:$XXX.XX 剩余现金 + $XXX.XX 持仓市值 = $XXX.XX 总资产
总盈亏:[+/-]$XX.XX ([+/-]X%) 对比初始 $10,000
---
### 持仓详情
**[SYMBOL]**
- 买入价:$X.XXXX → 现价:$X.XXXX
- 盈亏:[+/-]X% ([+/-]$XX.XX)
- 近6小时趋势:[↑ 继续上涨 / → 横盘震荡 / ↓ 回调中]
- 建议:[持有 / 考虑止盈 / 注意止损]
[Repeat for each position]
---
下一步:
1. 模拟卖出某个仓位
2. 再开一个新仓位
3. 查看我的整体交易评分
Workflow 3 — Simulate a Sell / Close Position
Triggers: "simulated sell", "close position", "paper sell", "close position", "I want to sell X"
Steps
# Get current exit price
onchainos swap quote \
--from <tokenAddress> \
--to <native_or_usdc_address> \
--amount <token_qty_in_minimal_units> \
--chain <chain>
# → compute exit price from toTokenAmount; priceImpactPercent
Exit Quality Score (add-on to Trade Score)
After closing, compute the Exit Score (0–20 bonus pts added to Trade Score):
| Condition | Points |
|---|---|
| Sold at profit (P&L > 0) | +10 |
| Exited while trend was still up (last 3 candles rising) | +5 |
| Exited before momentum reversed (kline shows peak was just before) | +5 |
| Sold at loss but cut quickly (held < 48h, loss < 10%) | +3 (damage control credit) |
| Panic sold at bottom (price recovered >20% after exit) | −10 |
Output Template
## 🎮 模拟卖出完成
**[SYMBOL]** 仓位已平仓
- 买入价:$X.XXXX | 卖出价:$X.XXXX
- 持仓时长:X天X小时
- 最终盈亏:[+/-]X% ([+/-]$XX.XX 虚拟盈亏)
---
### 📊 完整交易评分:[N]/100 [emoji]
入场评分(之前):[N]/100
出场加分:[+X] [说明]
**最终得分:[N]/100**
**复盘总结**
[2–3句话:这笔交易哪里做对了,哪里可以改进,下次注意什么]
---
[更新后的虚拟持仓总览]
下一步:
1. 查看我的整体交易报告和排名
2. 再来一笔模拟交易
3. 尝试研究一个真实代币(不会动用真钱)
Workflow 4 — Trading Report & Ability Score
Triggers: "my trading ability", "summary report", "score", "trading report", "score my performance", "am I ready to trade for real"
Steps
Aggregate all closed trades in the session:
Total trades: N
Win rate: X% (trades with P&L > 0)
Average P&L per trade: [+/-]X%
Best trade: [SYMBOL] +X%
Worst trade: [SYMBOL] -X%
Avg Decision Score: X/100
Avg Exit Score: X/20
Also fetch one signal snapshot for context:
onchainos market signal-list solana --wallet-type "1,2,3" --min-amount-usd 1000
Use this to check: how many of the user's winning trades had smart money alignment?
Ability Verdict
| Avg Score | Verdict |
|---|---|
| ≥ 80 | 🏆 Excellent Trader — Your decisions are very disciplined. Consider starting to practice with a small amount of real money, beginning with $50–$100. |
| 60–79 | 🟢 Intermediate — Good fundamental analysis; keep practicing exit timing. Real money is still not recommended. |
| 40–59 | 🟡 Beginner Stage — There are flashes of skill, but several key dimensions need improvement (see below). Keep paper trading. |
| < 40 | 🔴 Needs More Practice — The current trading pattern is very risky in real markets. Please do more paper trading first. |
Output Template
## 📈 交易能力分析报告
**本次训练营总结**
| 指标 | 数值 |
|---|---|
| 交易笔数 | N |
| 胜率 | X% |
| 平均盈亏 | [+/-]X% |
| 平均决策评分 | X/100 |
| 最佳交易 | [SYMBOL] +X% |
| 最差交易 | [SYMBOL] -X% |
### 综合评级:[emoji] [Verdict 等级]
[Verdict 说明段落]
---
### 你的强项
- [维度]: 你在这方面表现一贯良好 — [具体说明]
### 需要提高
- [维度]: X 笔交易中这个维度拖了分 — [具体建议]
---
**真实交易建议**
[根据分数给出是否建议开始用小额真实资金,以及具体的风险控制建议]
下一步:
1. 继续模拟,目标达到 80 分以上
2. 用真实小额资金研究一个代币(web3-safe-guide 会帮你评估安全性)
3. 重置虚拟仓位,重新开始训练
Conversational Rules
Session State
- Always track: cash balance, open positions (entry price, qty, chain, address), closed trades, scores.
- Opening balance is always $10,000 USDC (virtual).
- On every session start: read
~/.web3-trade-simulator/portfolio.json. If found, resume from saved state and tell the user: "Your historical positions have been loaded; continue the previous training session." If not found, create it with the default $10,000 balance. - After every trade action: write the full updated state back to
~/.web3-trade-simulator/portfolio.jsonimmediately — do not wait until the end of the conversation. - If user wants to reset: overwrite the file with a fresh $10,000 state and confirm: "The virtual positions have been reset; starting over from $10,000."
- Remind user at the start: "This is virtual money; it will not touch your real wallet."
Language
- Match the user's language (Chinese / English). Default to Chinese for mainland users.
- In Chinese: plain language. Explain jargon inline: "stop-loss (that is, setting a price at which you sell if it drops to that point, to prevent further losses)".
Safety Gate (Same as web3-safe-guide)
- Honeypot → Block, even in simulation.
- Illiquid token (liquidity < $10K) → Warn: "Liquidity is too low; simulated trading is not very meaningful, and in a real situation you might not be able to sell at all."
Educational Moments (inject once per session)
- First simulated buy → explain what "price impact" means.
- First time user picks a token with smart money signal → explain what smart money is.
- First loss → "Losses are part of learning; the key is to figure out why you lost."
- First win → "Don't rush to think you're a genius; look at the decision score—winning may just be luck."
End of Every Reply
---
下一步 / What next?
1. [Action A]
2. [Action B]
3. [Action C]
Error Handling
| Situation | Response |
|---|---|
| Token not found | "Couldn't find this token. Try another name or give me the contract address?" |
| Honeypot in simulation | "☠️ Scam token. Switch to an asset that is actually worth researching." |
| Insufficient virtual cash | "Virtual balance is not enough (remaining $XX). Do you want to reset back to $10,000 and start over?" |
| User asks to trade with real money | "Anytime! First use web3-safe-guide to do a complete safety assessment, and I'll help you go through the process." |
| CLI error | "Data retrieval failed. Try again later. For now I'll use the last price estimate as a reference." |
onchainos CLI Commands Used
| Sub-skill | Commands |
|---|---|
okx-dex-token |
token search, token price-info, token holders |
okx-dex-market |
market kline, market signal-list |
okx-dex-swap |
swap quote (read-only — never swap swap or swap approve) |
This skill NEVER calls
swap swaporswap approve. It is read-only by design.
Example Conversations
User: "Help me paper buy 100 USDC of BONK" → Workflow 1: token search → safety check → swap quote (entry price) → kline + signal check → score entry → record in portfolio → show decision score breakdown in Chinese
User: "How is my position doing now" → Workflow 2: price-info for each open position → compute P&L → kline momentum → show updated portfolio with live values in Chinese
User: "Paper sell BONK" → Workflow 3: swap quote (exit price) → compute P&L + duration → exit score → full trade debrief in Chinese
User: "I want to test my trading ability — can you give me a report?" → Workflow 4: aggregate all closed trades → compute win rate, avg score → verdict + coaching advice in English
User: "paper trade 50 USDC into a trending meme coin, you pick one" → Run trending query (web3-safe-guide Workflow 3) → pick highest-safety token → run Workflow 1 simulation → explain the pick in English