Skills paper-trading
Run a structured paper-trading loop with SQLite-backed event logging, position tracking, and PnL review. Use when opening/closing simulated trades, journaling thesis notes, checking portfolio status, or generating weekly performance summaries.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/brs999/paper-trader" ~/.claude/skills/openclaw-skills-paper-trading && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/brs999/paper-trader" ~/.openclaw/skills/openclaw-skills-paper-trading && rm -rf "$T"
manifest:
skills/brs999/paper-trader/SKILL.mdsource content
Paper Trading
SQLite-backed paper trading with immutable event logs.
Asset identity:
is required for trade/snapshot commands.symbol
is REQUIRED formint
andsnapshot
(open
).--mint <address>- If multiple positions share the same symbol, pass
for--mint
/close
so you target the right one.set-levels - For ETH/BTC on DEXs, use wrapped token contract addresses (
,WETH
/WBTC
) as the mint.cbBTC
When to Use
Use this skill when the user wants to:
- paper trade ideas before live capital
- track entries/exits/stops/takes over time
- compute realized and unrealized PnL
- keep a thesis journal and periodic review
Database
Default DB path:
~/.openclaw/paper-trading.db
Override with
--db <path>.
Commands
Use the script:
node --experimental-strip-types {baseDir}/scripts/paper_trading.ts --help
Environment notes:
- No npm dependency is required for SQLite (uses
).node:sqlite - Node may print
for SQLite in current versions; this is expected.ExperimentalWarning
1) Initialize account
node --experimental-strip-types {baseDir}/scripts/paper_trading.ts init \ --account main \ --name "Main Paper Account" \ --base-currency USD \ --starting-balance 10000
2) Log market snapshot (for unrealized PnL)
node --experimental-strip-types {baseDir}/scripts/paper_trading.ts snapshot \ --symbol BTC \ --mint 6p6xgHyF7AeE6TZk8x9mNQd2r2hH7r4mYJ8t6x6hYfSR \ --price 62000 \ --source dexscreener
3) Open position
node --experimental-strip-types {baseDir}/scripts/paper_trading.ts open \ --account main \ --symbol BTC \ --mint 6p6xgHyF7AeE6TZk8x9mNQd2r2hH7r4mYJ8t6x6hYfSR \ --side LONG \ --qty 0.1 \ --price 62000 \ --fee 4 \ --stop-price 60500 \ --take-price 65000 \ --max-risk-pct 1.5 \ --note "Breakout + volume confirmation"
4) Update stop/take
node --experimental-strip-types {baseDir}/scripts/paper_trading.ts set-levels \ --account main \ --symbol BTC \ --mint 6p6xgHyF7AeE6TZk8x9mNQd2r2hH7r4mYJ8t6x6hYfSR \ --side LONG \ --stop-price 61200 \ --take-price 66000 \ --note "Move stop to reduce downside"
5) Close position
node --experimental-strip-types {baseDir}/scripts/paper_trading.ts close \ --account main \ --symbol BTC \ --mint 6p6xgHyF7AeE6TZk8x9mNQd2r2hH7r4mYJ8t6x6hYfSR \ --side LONG \ --qty 0.05 \ --price 63500 \ --fee 3 \ --note "Partial take profit"
6) Journal note
node --experimental-strip-types {baseDir}/scripts/paper_trading.ts note \ --account main \ --symbol BTC \ --side LONG \ --note "Invalidation if daily close < 61k" \ --tags thesis risk macro
7) Portfolio status
node --experimental-strip-types {baseDir}/scripts/paper_trading.ts status --account main node --experimental-strip-types {baseDir}/scripts/paper_trading.ts status --account main --format json --pretty
8) Weekly review
node --experimental-strip-types {baseDir}/scripts/paper_trading.ts review --account main node --experimental-strip-types {baseDir}/scripts/paper_trading.ts review --account main --format json --pretty
Workflow
- Keep snapshots updated for symbols with open positions, always with
and--mint
.--source dexscreener - Open trades only with explicit stop and risk cap (
).--max-risk-pct - Log every change as an event, do not edit old events.
- Run
after each trade andstatus
at week end.review
Notes
- Events are append-only in SQLite (
table).events - PnL is recomputed by replaying events.
uses the latest snapshot perstatus
pair for unrealized PnL.symbol + mint
Validation
Run the full paper-trading test suite:
node --test {baseDir}/tests/paper_trading.test.mjs