---
title: "Run grid-bot backtest (x402, $0.10)"
method: POST
path: "/api/v1/agent/backtests/grid"
tags: ["Agent (x402)"]
---

# Run grid-bot backtest (x402, $0.10)

`POST /api/v1/agent/backtests/grid`

## Request

- Base URL: `https://tradingstrategies.work`
- URL: `https://tradingstrategies.work/api/v1/agent/backtests/grid`
- Auth: none declared

Simulate a KuCoin-style grid bot on historical candles. All crypto pairs unlocked for x402 callers (payment IS entitlement).

**Pricing:** $0.10 USDC pay-per-call (x402). No account / no API key.
On-demand backtest, computed inline (no DB-persistence for anonymous x402 callers).

## Request body

- object
  - `pair` string, required
  - `start_date` string, date, required
  - `end_date` string, date, required
  - `total_investment` number, required
  - `low_price` number, required
  - `high_price` number, required
  - `grid_count` integer, required
  - `grid_type` 'arithmetic' | 'geometric'
  - `fee_rate` number
  - `entry_price` number
  - `stop_loss_price` number
  - `take_profit_price` number
  - `stop_on_range_exit` boolean: Default false (grid pauses outside the range). true: stop at the first close outside the range, coins sold at that close.

## Response `200`

Settled payment + data payload.

- object

## Other responses

- `400`: Invalid input — fehlt Pflichtfeld oder Wert außerhalb des erlaubten Bereichs.
- `401`: Unauthenticated — kein gültiger Bearer-Token im Authorization-Header.
- `402`: Payment required. Body + `payment-required` header contain payment-instructions (network, payTo, amount, asset).
- `403`: Tier-Insufficient — Endpoint braucht höheren API-Tier. Response enthält upgrade_url.
- `404`: Not-Found — Resource existiert nicht oder gehört nicht dem aktuellen User.
- `429`: Rate-Limit überschritten — Tier-Quota (hourly/daily) oder Per-Endpoint-Quota erreicht. Retry-After-Header gesetzt.
- `500`: Internal Error.
- `503`: Upstream-Failure — Datenquelle nicht erreichbar (Binance, EODHD, etc.).

---

[API](https://skmtc.dev/tradingstrategies/apis/backtesting-arena-public-api.md) · [All operations](https://skmtc.dev/tradingstrategies/apis/backtesting-arena-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tradingstrategies/apis/backtesting-arena-public-api/revisions/f82e8d6eecd7?raw)
