# Mangrove Developer Backtesting API

> Mangrove Developer Backtesting API is a paid API for AI agents from api.mangrovedeveloper.ai, paid per call via x402, $0.1/call, status unknown (last checked 2026-11-04).

Runs a strategy backtest against historical market data with configurable risk parameters, trade limits, and volatility settings.

## Facts

- Endpoint: POST https://api.mangrovedeveloper.ai/api/v1/backtesting/backtest?utm_source=zero.xyz
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-04
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mangrove-developer-backtesting-api-06ecc4a2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pwsekU5kHZc2ILiKpGXWY

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability mangrove-developer-backtesting-api-06ecc4a2 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Developer references for Mangrove Agent, API contracts, MCP and AI integrations.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mangrove-developer-backtesting-api-06ecc4a2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.mangrovedeveloper.ai](https://www.zero.xyz/host/api.mangrovedeveloper.ai/llms.txt)
