Platform Documentation
Technical reference for the Trading Cards algorithmic trading platform · ZK proofs · Sui NFTs · Backtesting
Trading Cards is an algorithmic trading platform designed to enhance and simplify the trading space. Users can easily create, backtest, and mint strategies as verifiable financial NFT assets backed with ZK proofs on the blockchain. Investors can also view and verify top-performing NFT strategies and their backtest and live results — Win Rate, Sharpe Ratio, Total Trades, and PnL.
Users have a wide variety of parameters to select from while backtesting — including exchange, symbols, timeframe, patterns, date range, position size, leverage, and more — making this a powerful and dynamic feature.
Algorithmic trading has a trust problem.
Anyone can claim their strategy returns 200% annually. Anyone can publish a backtest screenshot. There is currently no trustless, verifiable way for a strategy creator to prove their results are genuine without revealing the strategy itself — and no way for an investor to verify a claim without simply trusting the person making it.
This creates three compounding issues:
Trading Cards solves all three problems simultaneously using zero-knowledge proofs and the Sui blockchain.
The platform is built on Next.js with a TypeScript API layer, MongoDB for persistent storage, Redis for ephemeral caching, and the RISC0 zkVM running as a native binary alongside the server process.
Frontend (Next.js)
├── Strategies Page ──→ Backtester Page ──→ Results + Proof
│ ↕ ↕ ↕
│ MongoDB (cards) SSE Stream ProofButton
│
API Routes (Next.js)
├── /backtest/stream GET SSE progress stream
├── /backtest/cancel POST Cancel via Redis flag
├── /backtest/prove POST Run prover + mint NFT
└── /verify GET Public proof lookup
↓ ↓
Redis Cache RISC0 zkVM Host
proof:candles:{runId} proof_receipt.bin
proof:entries:{runId} proof_output.json
↓ ↓
Storage Layer
├── MongoDB receipts (BSON Binary), proofs, users/cards
├── Walrus proof_receipt.bin (blob ID referenced on-chain)
└── Sui Strategy NFTs (public outputs)The backtester is the platform's core computation engine, designed to mirror real trading conditions as closely as possible. Backtests run in three sequential phases:
Performance Metrics
| Metric | Description |
|---|---|
| Total Return | Percentage gain or loss relative to initial capital |
| Win Rate | Percentage of trades that hit take-profit before stop-loss or expiry |
| Sharpe Ratio | Risk-adjusted return (annualised excess return / standard deviation) |
| Max Drawdown | Largest peak-to-trough decline in account balance |
| Avg PnL / Trade | Mean dollar profit or loss per executed trade |
| Best / Worst | Highest and lowest individual trade by dollar PnL |
| Per-Symbol | Trades, PnL, and win rate segmented by trading pair |
Supported Strategies
| Strategy | Direction | Key Parameters |
|---|---|---|
| Bullish / Bearish Divergence | Both | RSI difference, RSI threshold, lookback hours |
| Bullish / Bearish Engulfing | Both | Prev candle body %, RSI threshold |
| Overly Sold | Bullish | RSI below threshold, lookback hours |
| Bollinger Band Breakout | Both | % outside band |
Backtest Configuration
| Parameter | Description |
|---|---|
| Exchange | Bybit (Derivatives, Spot, Commodity) |
| Symbol Override | Comma-separated pairs, or all available symbols |
| Timeframe | 1m, 3m, 5m, 15m, 30m, 1h, 4h, 1d |
| Date Range | Arbitrary start and end date |
| Initial Capital | Starting account balance in USD |
| Position Size | Dollar amount allocated per trade |
| Leverage | Multiplier applied to position size |
| Take Profit | Target gain percentage per trade |
| Stop Loss | Maximum loss percentage per trade |
| Expiry Candles | Number of candles before a trade is forcibly closed |
| Entry Offset | Number of candles after signal before entry |
What is a ZK Proof?
A zero-knowledge proof is a cryptographic protocol that allows one party (the prover) to convince another party (the verifier) that a statement is true, without revealing any information beyond the truth of the statement itself.
How RISC0 Works
Trading Cards uses the RISC0 zkVM — a zero-knowledge virtual machine that can prove the correct execution of any Rust program. The backtest logic is compiled to run inside the zkVM. When the program runs:
- It takes private inputs — the strategy config, candle data, and trade signals — which are never exposed.
- It produces public outputs — the candle data hash, trade statistics — which are committed to the proof receipt.
- The STARK proof receipt cryptographically guarantees that the public outputs were produced by the correct program running on the private inputs.
Private vs Public Outputs
| Data | Visibility | Why |
|---|---|---|
| Strategy parameters (TP, SL, RSI) | Private | User's intellectual property |
| Candle data | Private | Not needed on-chain |
| Candle data hash | Public | Verifiable against Bybit's API |
| Trade count, win rate, PnL, Sharpe | Public | The claims being proven |
| Strategy name hash | Public | Identifies strategy type |
| Circuit image ID | Public | Identifies the exact circuit version |
A Strategy NFT is a Sui object that represents a verified algorithmic trading strategy. It is minted after a ZK proof is successfully generated and contains only the public outputs from the proof circuit.
NFT Data Model
struct BacktestProof has key, store {
id: UID
image_id: String // RISC0 circuit version
journal_digest: String // Hash of all public outputs
candle_hash: String // SHA-256 of candle data
strategy_id: String // Hash of strategy name
total_trades: u64
win_rate_bps: u64 // 6500 = 65.00%
total_pnl_bps: u64 // 2341 = +23.41%
sharpe_x1000: u64 // 1840 = Sharpe 1.840
timestamp: u64 // Unix ms
version: String // "pattern:proof:v1"
}Minting Flow
- User completes a backtest and views results
- User clicks "Generate Proof" — the platform calls
POST /api/backtest/prove - The API reads cached candle data from Redis and runs the RISC0 prover
- The receipt is uploaded to Walrus; the blob ID is stored in the NFT
- The API calls
mint_proofon the deployed Move contract - The NFT is transferred to the user's Sui wallet address
- A transaction digest and Sui Explorer link are returned to the user
Any third party can verify a strategy proof independently, without trusting the Trading Cards platform.
GET https://tradingcards.app/api/backtest/prove?proofId=<id>
curl "https://tradingcards.app/api/backtest/prove/receipt?proofId=<id>" \ -o proof_receipt.bin
# Install RISC0 curl -L https://risczero.com/install | bash # Verify rzup verify \ --receipt proof_receipt.bin \ --image-id <IMAGE_ID>
candle_hash in the public outputs is a SHA-256 of the exact candles fed to the circuit. Fetch the same candles from Bybit's public REST API, hash them, and compare. A matching hash proves the proof used real, unmanipulated market data.Strategy NFTs represent the base layer of the platform's economic model. Key properties:
Strategy Config Privacy
The strategy configuration is the user's intellectual property. It never leaves the Trading Cards server:
- The config is passed to the RISC0 prover as a private input and deleted from disk after proof generation
- It is stored in MongoDB as
_privateConfigfor internal audit, but never returned by any API endpoint and never put on-chain - The ZK proof mathematically guarantees the results without requiring the config to be disclosed
Wallet-Scoped Storage
Saved backtest configurations are stored scoped to the user's Sui wallet address. No authentication system beyond wallet ownership is required.
Candle Data Caching
During backtesting, candle data and trade signals are cached in Redis under the runId with a 2-hour TTL. This data is consumed by the prover and deleted from Redis immediately after proof generation. It is never exposed to the browser.
Proof Receipt Integrity
The proof receipt is stored as immutable BSON Binary in MongoDB and uploaded to Walrus with a 1-year epoch commitment. The receipt is content-addressed — any modification to the bytes would invalidate the STARK proof.
- Backtester with SSE streaming and real-time progress
- ZK proof generation via RISC0
- Proof storage in MongoDB and Walrus
- Public verification portal
- Saved configurations tied to Sui wallet
- Strategy NFT minting on Sui mainnet
- NFT marketplace for strategy discovery and trading
- On-chain proof verification via Sui Move contract
- Walrus integration for decentralised receipt storage
- Live strategy execution linked to NFT identity
- Real-time performance metrics updated on-chain
- Investor subscription model — mirror a strategy's trades
- Performance-based fee distribution to strategy creators
- Third-party strategy import (Pine Script, Python)
- Multi-exchange support beyond Bybit
- Social layer — followers, comments, leaderboards
- API access for programmatic strategy submission