Documentation Index Fetch the complete documentation index at: https://docs.generalmarket.io/llms.txt
Use this file to discover all available pages before exploring further.
Simulation API
Hindsight as a service. Run backtests against crypto data from 2020 to today. The results are always instructive and never actionable — past performance guarantees nothing except the knowledge that you could have done better.
All GET requests. No authentication. Base URL: https://generalmarket.io/api
List Categories
The universe of things you can backtest.
curl "https://generalmarket.io/api/sim/categories"
{
"categories" : [
{ "id" : "layer-1" , "name" : "Layer 1" , "coin_count" : 45 , "source" : "coingecko" },
{ "id" : "dl-dexes" , "name" : "Decentralized Exchanges" , "coin_count" : 32 , "source" : "defillama" },
{ "id" : "meme-token" , "name" : "Meme Coins" , "coin_count" : 120 , "source" : "coingecko" },
{ "id" : "artificial-intelligence" , "name" : "AI & Big Data" , "coin_count" : 38 , "source" : "coingecko" }
]
}
Run Backtest
One simulation. One set of parameters. Cached when possible, computed when not.
curl "https://generalmarket.io/api/sim/run? \
category_id=layer-1& \
top_n=10& \
weighting=mcap& \
rebalance_days=30& \
base_fee_pct=0.1& \
spread_multiplier=1.0"
Parameters
Parameter Type Required Default Description category_idstring Yes — Category slug from /sim/categories top_nint Yes — Number of top assets by market cap weightingstring Yes — Weighting scheme (see Backtesting Guide ) rebalance_daysint Yes — Days between rebalances base_fee_pctfloat No 0.1Fee percentage per rebalance spread_multiplierfloat No 1.0Slippage multiplier start_datestring No Earliest data ISO date YYYY-MM-DD forcebool No falseSkip cache, recompute threshold_pctfloat No — Drift-based rebalance threshold (%) fng_modestring No — Fear & Greed regime (fear, greed, both) fng_fear_thresholdint No 25FNG below this = fear regime fng_greed_thresholdint No 75FNG above this = greed regime fng_cash_pctfloat No 0.4% to stables during greed dom_modestring No — Dominance regime (btc, eth, inverse) dom_lookbackint No 30Lookback days for dominance trend vc_modestring No — VC filter mode vc_investorsstring No — Comma-separated investor names vc_min_amount_mfloat No — Min funding amount ($M) vc_round_typesstring No — Comma-separated round types
Response
Show Full Response Schema
{
"run_id" : 4821 ,
"config" : {
"category_id" : "layer-1" ,
"top_n" : 10 ,
"weighting" : "mcap" ,
"rebalance_days" : 30 ,
"base_fee_pct" : 0.1 ,
"spread_multiplier" : 1.0
},
"stats" : {
"total_return_pct" : 312.45 ,
"annualized_return" : 32.8 ,
"max_drawdown_pct" : -72.1 ,
"sharpe_ratio" : 0.94 ,
"total_fees_pct" : 1.8 ,
"total_trades" : 248 ,
"total_rebalances" : 72 ,
"total_delistings" : 5 ,
"start_date" : "2020-01-01" ,
"end_date" : "2026-02-27"
},
"nav_series" : [
{ "date" : "2020-01-01" , "nav" : 1.0 },
{ "date" : "2020-01-02" , "nav" : 1.012 }
],
"cached" : true ,
"computed_in_ms" : 0
}
Field Type Description run_idint Unique ID for fetching holdings or comparing runs stats.total_return_pctfloat Cumulative return (e.g., 312.45 = 312.45%) stats.annualized_returnfloat Annualized return % stats.max_drawdown_pctfloat Maximum peak-to-trough decline (negative) stats.sharpe_ratiofloat Risk-adjusted return metric stats.total_fees_pctfloat Cumulative fees across all rebalances stats.total_tradesint Number of individual trades executed stats.total_rebalancesint Number of rebalance events stats.total_delistingsint Assets removed mid-backtest nav_seriesarray Daily NAV points starting at 1.0 cachedbool Whether the result was served from cache computed_in_msint Computation time (0 if cached)
Run Backtest (Streaming)
Same simulation, but streamed. Watch the backtest compute in real time.
curl -N "https://generalmarket.io/api/sim/run-stream? \
category_id=layer-1&top_n=10&weighting=mcap&rebalance_days=30"
SSE event types:
Type Fields Description progresspct, current_dateSimulation progress (0–100%) resultSame as /sim/run response Final result errorerrorError message if simulation fails
Sweep Stream
Vary one parameter, hold the rest constant. See what matters and what does not.
Parameter Type Required Description sweepstring Yes Dimension to sweep: top_n, weighting, rebalance, category, threshold category_idstring Yes Category slug categoriesstring No Comma-separated category IDs (for sweep=category) All /sim/run params — Varies Base configuration (the non-swept param values)
Sweep top_n
Sweep weighting strategies
Sweep rebalance frequency
curl -N "https://generalmarket.io/api/sim/sweep-stream? \
sweep=top_n&category_id=layer-1&weighting=mcap&rebalance_days=30"
Sweep values per dimension:
Sweep Values Tested top_n5, 10, 20, 30, 50, 100, 200 weightingAll available schemes (11 base + 9 DeFi for dl-* categories) rebalance14d, 30d, 60d, 90d, 180d + drift bands at 3%, 5%, 10%, 15%
Get Holdings
What the backtest was holding at any point in time.
Parameter Type Required Description run_idint Yes Run ID from a backtest result datestring No Specific rebalance date (YYYY-MM-DD). Defaults to latest.
curl "https://generalmarket.io/api/sim/holdings?run_id=4821"
Compare Runs
Multiple backtests, overlaid. The comparison is the point.
Parameter Type Required Description run_idsstring Yes Comma-separated run IDs (e.g., 4821,4822,4823)
curl "https://generalmarket.io/api/sim/compare?run_ids=4821,4822,4823"
List Cached Results
Everything the engine has already computed. Filtered by category if you wish.
Parameter Type Required Description category_idstring No Filter by category
curl "https://generalmarket.io/api/sim/results?category_id=layer-1"
Get Benchmarks
BTC and ETH, normalized to 1.0 at the start date. The benchmarks against which every strategy is judged.
Parameter Type Required Description start_datestring Yes ISO date YYYY-MM-DD end_datestring No ISO date (defaults to today)
curl "https://generalmarket.io/api/sim/benchmarks?start_date=2020-01-01"