Skip to main content

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.
GET /sim/categories
curl "https://generalmarket.io/api/sim/categories"

Run Backtest

One simulation. One set of parameters. Cached when possible, computed when not.
GET /sim/run
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

ParameterTypeRequiredDefaultDescription
category_idstringYesCategory slug from /sim/categories
top_nintYesNumber of top assets by market cap
weightingstringYesWeighting scheme (see Backtesting Guide)
rebalance_daysintYesDays between rebalances
base_fee_pctfloatNo0.1Fee percentage per rebalance
spread_multiplierfloatNo1.0Slippage multiplier
start_datestringNoEarliest dataISO date YYYY-MM-DD
forceboolNofalseSkip cache, recompute
threshold_pctfloatNoDrift-based rebalance threshold (%)
fng_modestringNoFear & Greed regime (fear, greed, both)
fng_fear_thresholdintNo25FNG below this = fear regime
fng_greed_thresholdintNo75FNG above this = greed regime
fng_cash_pctfloatNo0.4% to stables during greed
dom_modestringNoDominance regime (btc, eth, inverse)
dom_lookbackintNo30Lookback days for dominance trend
vc_modestringNoVC filter mode
vc_investorsstringNoComma-separated investor names
vc_min_amount_mfloatNoMin funding amount ($M)
vc_round_typesstringNoComma-separated round types

Response

FieldTypeDescription
run_idintUnique ID for fetching holdings or comparing runs
stats.total_return_pctfloatCumulative return (e.g., 312.45 = 312.45%)
stats.annualized_returnfloatAnnualized return %
stats.max_drawdown_pctfloatMaximum peak-to-trough decline (negative)
stats.sharpe_ratiofloatRisk-adjusted return metric
stats.total_fees_pctfloatCumulative fees across all rebalances
stats.total_tradesintNumber of individual trades executed
stats.total_rebalancesintNumber of rebalance events
stats.total_delistingsintAssets removed mid-backtest
nav_seriesarrayDaily NAV points starting at 1.0
cachedboolWhether the result was served from cache
computed_in_msintComputation time (0 if cached)

Run Backtest (Streaming)

Same simulation, but streamed. Watch the backtest compute in real time.
GET /sim/run-stream
curl -N "https://generalmarket.io/api/sim/run-stream?\
category_id=layer-1&top_n=10&weighting=mcap&rebalance_days=30"
SSE event types:
TypeFieldsDescription
progresspct, current_dateSimulation progress (0–100%)
resultSame as /sim/run responseFinal result
errorerrorError message if simulation fails

Sweep Stream

Vary one parameter, hold the rest constant. See what matters and what does not.
GET /sim/sweep-stream
ParameterTypeRequiredDescription
sweepstringYesDimension to sweep: top_n, weighting, rebalance, category, threshold
category_idstringYesCategory slug
categoriesstringNoComma-separated category IDs (for sweep=category)
All /sim/run paramsVariesBase configuration (the non-swept param values)
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:
SweepValues 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.
GET /sim/holdings
ParameterTypeRequiredDescription
run_idintYesRun ID from a backtest result
datestringNoSpecific 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.
GET /sim/compare
ParameterTypeRequiredDescription
run_idsstringYesComma-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.
GET /sim/results
ParameterTypeRequiredDescription
category_idstringNoFilter 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.
GET /sim/benchmarks
ParameterTypeRequiredDescription
start_datestringYesISO date YYYY-MM-DD
end_datestringNoISO date (defaults to today)
curl "https://generalmarket.io/api/sim/benchmarks?start_date=2020-01-01"