{"uid":"cap_pwsekU5kHZc2ILiKpGXWY","slug":"mangrove-developer-backtesting-api-06ecc4a2","name":"Mangrove Developer Backtesting API","description":"Developer references for Mangrove Agent, API contracts, MCP and AI integrations.","url":"https://api.mangrovedeveloper.ai/api/v1/backtesting/backtest?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"seed":{"type":"integer"},"asset":{"type":"string"},"fee_pct":{"type":"number"},"end_date":{"type":"string"},"exchange":{"type":"string"},"interval":{"type":"string"},"data_file":{"type":"string"},"base_token":{"type":"string"},"generation":{"type":"integer"},"start_date":{"type":"string"},"data_source":{"type":"string"},"quote_token":{"type":"string"},"strategy_id":{"type":"string"},"slippage_pct":{"type":"number"},"cooldown_bars":{"type":"integer"},"strategy_json":{"type":"string"},"corpus_dataset":{"type":"string"},"initial_balance":{"type":"number"},"lookback_months":{"type":"integer"},"volatility_mode":{"type":"string"},"execution_config":{"type":"object"},"hourly_data_file":{"type":"string"},"max_trade_amount":{"type":"number"},"min_trade_amount":{"type":"number"},"market_data_venue":{"type":"string"},"target_volatility":{"type":"number"},"volatility_window":{"type":"integer"},"max_open_positions":{"type":"integer"},"max_risk_per_trade":{"type":"number"},"max_trades_per_day":{"type":"integer"},"max_units_per_trade":{"type":"number"},"daily_momentum_limit":{"type":"number"},"initial_asset_balance":{"type":"number"},"min_balance_threshold":{"type":"number"},"weekly_momentum_limit":{"type":"number"},"enable_volatility_adjustment":{"type":"boolean"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.1","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.1/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_18v1Y0RrrmBZyuDDHV-1i","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.1","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs a strategy backtest against historical market data with configurable risk parameters, trade limits, and volatility settings.","exampleAgentPrompt":"Run a backtest on strategy 'strat-momentum-01' for the BTC/USDC pair on Coinbase from 2023-01-01 to 2023-12-31, using 1-hour intervals, an initial balance of 10000 USDC, 0.1% fee, 0.05% slippage, max 5 trades per day, and enable volatility adjustment.","exampleUseCases":[{"title":"Momentum strategy performance review","prompt":"Backtest my momentum strategy (strategy ID: strat-momentum-01) on ETH/USDC on Binance from 2024-01-01 to 2024-06-30, with 4-hour intervals, starting balance of 50000 USDC, 0.15% fee, 0.1% slippage, and a daily momentum limit of 0.05."},{"title":"Volatility-adjusted DCA bot simulation","prompt":"Simulate my DCA strategy (strategy JSON attached) on BTC/USDC on Coinbase from 2022-06-01 to 2023-06-01 with hourly intervals, initial balance of 20000, 0.1% fee, volatility mode set to 'adaptive', target volatility of 0.02, and a 10-bar cooldown between trades."},{"title":"Risk-constrained strategy stress test","prompt":"Run a backtest for strategy strat-risk-05 on SOL/USDC on Kraken between 2023-03-01 and 2024-03-01, using daily intervals, 25000 USDC starting balance, max 2 open positions, max risk per trade of 2%, max trade amount of 5000, and min balance threshold of 1000."}],"resultDescription":"Returns backtest simulation results including portfolio performance over the specified period, trade-by-trade history, final balance, risk metrics, and strategy evaluation statistics based on the configured parameters.","failureModes":["Invalid strategy_id or malformed strategy_json returns a 400 error","start_date after end_date causes a validation error","Unsupported exchange or interval combination may return a 422 error","Insufficient historical data for the specified date range returns an error","Missing required fields such as asset or initial_balance causes a 400 bad request","Payment of 0.1 USDC not settled via x402 results in a 402 Payment Required response"],"whenToPreferThis":"Choose this endpoint when you need to simulate the historical performance of a trading strategy against real or synthetic market data with fine-grained risk controls including per-trade limits, volatility targeting, momentum caps, and slippage modeling. Prefer this over generic analytics endpoints when strategy-specific configuration (strategy_id, strategy_json, execution_config) and crypto trading parameters are needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-04T06:33:30.959Z","isFirstParty":false,"canonicalSlug":"mangrove-developer-backtesting-api-06ecc4a2"}