EventTrader
AI-Native Trading
PAPER
Menu
Dark Mode
Plain English Mode
PAPER TRADING MODE — Enable real trading on your Account page
Back

Research Backtest — REST API

Run the headline-basket research engine (AIB sentiment baskets with theme / spike / MACD / BTC-regime / quality gates and the experimental odiv/oboss models), stream progress over WebSocket, and launch a result as a tradeable Rally Card. Signal/backtest only — no orders are placed.

Run a backtest

POST /api/v1/research-backtest/run

{
  "label": "defi + ai sweep",
  "themes": ["defi tokens", "ai tokens"],
  "algo_model": "aib_sentiment",            // or "odiv" / "oboss" (experimental)
  "hold_days": 2, "top_k": 12,
  "long_band": 0.85, "short_band": 0.94,
  "spike_window_hours": 24, "spike_up_min_pct": 5,
  "macd_gate": true, "btc_regime_gate": true,
  "min_volume_usd": 10000, "max_crypto_rank": 1000,
  "symbols": "", "exclude_symbols": "USDT,USDC"
}

Returns { "run_id", "instance_id", "status": "queued", "ws" }. Stream progress at:

ws://HOST/ws/backtest/{instance_id}?run_id={run_id}
// messages: {type:"progress",progress_pct,status} … {type:"completed",result} | {type:"failed",error}

Read runs

GET /api/v1/research-backtest/runs — list recent runs (index).

GET /api/v1/research-backtest/runs/{run_id} — full run JSON (parameters, summary, per-basket rows with components + vs-BTC).

Form metadata

GET /api/v1/research-backtest/themes — selectable themes (multi-select).

GET /api/v1/research-backtest/models — algo models + experimental caveats.

Launch a Rally Card

POST /api/v1/research-backtest/runs/{run_id}/launch-rally-card (authenticated) — { "basket_index": 0 }. Launches that basket as a signal-only, ledger-only Rally Card for a $0.99 fee from your own balance (no backing). Idempotent per basket; 402 on insufficient balance. Returns { ok, card_id, trade_url }.

Leaderboard

GET /api/v1/research-backtest/leaderboard?section=all&sort=vs_btc — ranked runs + launched cards. The page subscribes to /ws/research-backtest-leaderboard (and /ws/event-cards for live index ticks) — real-time, no polling.

Chart (BTC vs backtests)

GET /api/v1/research-backtest/chart?live=4 — cumulative-return equity curves: the top all-time backtest vs BTC (compounded over the run's trade windows) plus the most recent live backtests. Each curve is {run_id, label, final_backtest, final_btc, points:[{t, backtest, btc}]}. The leaderboard WebSocket pushes a fresh copy in the data.chart field on every run completion — the page paints once then updates live.