Paper Trading for Openclaw

A structured paper-trading system with SQLite-backed event logging and real-time PnL tracking for AI agents.

brs999
v1.0.1
Mar 5, 2026
1
1.2k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install paper-trader

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install paper-trader using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Paper Trading?

This skill provides a robust framework for simulating financial trades without risking live capital. By utilizing a local SQLite database, it ensures that every trade, market snapshot, and thesis note is recorded as an immutable event, allowing for precise audit trails and historical performance analysis. It is designed to work seamlessly within the Openclaw Skills ecosystem, enabling AI coding agents to manage simulated portfolios, calculate realized and unrealized gains, and maintain a trading journal with high technical precision.

Paper Trading Use Cases

  • Testing new trading strategies before deploying real capital.
  • Logging trade entries, exits, stop-losses, and take-profit levels.
  • Calculating unrealized PnL based on periodic market snapshots.
  • Maintaining a detailed trading journal with thesis notes and risk assessments.
  • Generating weekly performance reviews and portfolio status reports.

How Paper Trading Works

  1. Initialize a trading account with a base currency and starting balance.
  2. Record market snapshots for specific assets (using symbols and mint addresses) to provide price context.
  3. Open long or short positions with defined risk parameters, stop prices, and take-profit targets.
  4. Log periodic updates, such as moving stop-losses or adding journal notes to the immutable event stream.
  5. Close positions partially or fully to realize PnL.
  6. Replay the event log to calculate current portfolio status or generate comprehensive performance reviews.

Paper Trading Setup

Ensure you have Node.js installed. The skill uses the native node:sqlite module and requires no external npm dependencies for database management. Initialize your account using the following command:

node --experimental-strip-types {baseDir}/scripts/paper_trading.ts init \
  --account main \
  --name "Main Paper Account" \
  --base-currency USD \
  --starting-balance 10000

To verify the setup, you can run the status command:

node --experimental-strip-types {baseDir}/scripts/paper_trading.ts status --account main

Paper Trading Data Schema & Taxonomy

The skill manages data through an append-only SQLite database located at ~/.openclaw/paper-trading.db. The schema focuses on event-sourcing principles:

Component Details
Accounts Defined by unique IDs, base currencies, and starting balances.
Events Table The source of truth; contains immutable logs of all trades, level changes, and notes.
Snapshots Stores price data per symbol/mint pair for calculating unrealized PnL.
Identification Assets are tracked via symbol and mandatory mint addresses for DEX tokens.

Paper Trading Advanced Features

  • Immutable Event Sourcing: PnL is recomputed by replaying historical events, ensuring data integrity.
  • DEX-Ready Asset Tracking: Requires mint addresses for assets like WETH or WBTC to prevent symbol collisions.
  • Integrated Risk Management: Supports max-risk-percentage flags to enforce disciplined position sizing.
  • Flexible Journaling: Attach tags and notes to specific positions for deep thesis review.
  • Multi-Format Export: Generate status and review reports in JSON for integration with other Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*