- Rust engine: real bootstrap/wiring preflight (guardrail-agent), execution layer (retry/router/pre-trade/post-trade/reconciliation), guardrail-doctor diagnostics with allowlist-drift guard. - guardrail-cli: extracted pure helpers into util.rs (split in progress). - 6 Track-2 skills + ensemble; python-lab analytics (regime/drawdown/montecarlo/dossier/ensemble/journal/seed); clients (ts/py/go/mcp/langchain/web-lite/proof-verifier); alert relay; scenarios; helm/k8s/compose; docs. - dashboard/vercel.json + docs/VERCEL_DEPLOY.md for Vercel deployment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
68 lines
2.8 KiB
Markdown
68 lines
2.8 KiB
Markdown
# Backtest Specification Prompt — <PLACEHOLDER_SKILL_NAME> (TEMPLATE)
|
|
|
|
Describe — and produce — a defensible backtest of this strategy so a judge can
|
|
reproduce and trust the reported numbers.
|
|
|
|
## Replay data
|
|
|
|
- **Universe**: the 20 eligible BSC tokens (`configs/eligible_assets.bsc.json`).
|
|
- **Signal**: <PLACEHOLDER how this skill's raw signal is replayed alongside the
|
|
market snapshot, and its source (Rust file or CMC endpoint)>.
|
|
- **Source**: CMC historical quotes + OHLCV (`/v2/cryptocurrency/ohlcv/historical`),
|
|
Fear & Greed history (`/v3/fear-and-greed/historical`), and DEX liquidity
|
|
snapshots. The Rust `backtester` crate can also run over a synthetic market path
|
|
for deterministic regression tests.
|
|
- **Granularity**: hourly candles; regime + signal tilt + rebalance evaluated each
|
|
cycle.
|
|
- **Period**: a minimum 90-day window covering at least one risk_on, one risk_off,
|
|
and one chop stretch; report start/end timestamps.
|
|
|
|
## Cost & execution assumptions
|
|
|
|
- **Fees**: PancakeSwap v3 swap fee (0.25% default tier) per leg.
|
|
- **Slippage**: modelled from DEX liquidity depth vs clip size; capped at the
|
|
policy `max_slippage_pct` of 0.8%. TWAP splitting for large clips.
|
|
- **Gas**: fixed BSC gas estimate per swap (configurable, e.g. $0.20/tx).
|
|
- **Quote-before-swap**: required; reject fills that exceed the slippage cap.
|
|
|
|
## Risk gates applied during replay
|
|
|
|
- Per-name cap 17% (policy max 18%), stable reserve floor (>= 10%, target 15%).
|
|
- Stop-loss 12%, take-profit 25% per position.
|
|
- <PLACEHOLDER any signal-specific entry/exit gate>.
|
|
- Drawdown throttle at 22% total drawdown (block new buys), kill switch latches at
|
|
24% (halt trading).
|
|
- Daily-trade requirement: >= 1 trade/day (heartbeat <= 0.10% NAV when flat).
|
|
|
|
## Metrics to report
|
|
|
|
- Total return, CAGR, max drawdown, Sharpe & Sortino, Calmar.
|
|
- Hit rate, average win/loss, turnover, time-in-market vs reserve.
|
|
- Per-regime attribution (PnL contributed in each regime).
|
|
- **Signal attribution**: PnL attributable to this skill's tilt vs the base alpha
|
|
(compare against a base-alpha-only run on the same window).
|
|
- Kill-switch / throttle activations and their dates.
|
|
- Number of trades and daily-requirement compliance rate.
|
|
|
|
## How to run
|
|
|
|
```bash
|
|
# Synthetic-path regression backtest (deterministic)
|
|
guardrail-cli backtest --steps 720 --preset default
|
|
|
|
# Compare presets side by side
|
|
guardrail-cli backtest-presets --steps 720
|
|
|
|
# Full event-driven simulation over real CMC replay data
|
|
guardrail-sim --config configs/strategy_presets.json
|
|
|
|
# Python research / metrics notebooks
|
|
# python-lab/ (stdlib + notebooks for attribution and charts)
|
|
```
|
|
|
|
## Output
|
|
|
|
A backtest report (markdown) with the metrics above, the equity curve, a
|
|
per-regime attribution table, a signal-attribution breakdown, and an explicit
|
|
list of every risk-gate activation.
|