# FiatDock Crypto Backtester

> FiatDock Crypto Backtester is a paid API for AI agents from fiatdock.com, paid per call via x402, $0.009/call, status unknown (last checked 2026-10-17).

Backtests a trading strategy (SMA crossover, RSI mean reversion, DCA, or buy-and-hold) against a crypto asset's historical daily USD closes on Coinbase Exchange, returning full performance metrics and trade log compared to buy-and-hold.

## Facts

- Endpoint: GET https://fiatdock.com/v1/market/backtest?utm_source=zero.xyz
- Price: $0.009/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fiatdock-crypto-backtester-b71a42c1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Raw0UKACpMSBGvTBQnuvK

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 fiatdock-crypto-backtester-b71a42c1
```

Example prompt: Run a backtest on Bitcoin using an SMA crossover strategy with a 20-day fast and 50-day slow moving average over the last 180 days, assume $1,000 starting capital and a 10 basis point fee, and show me how it compares to just buying and holding.

## When to prefer this

Choose this endpoint when you need to quickly evaluate whether a specific trading rule (SMA crossover, RSI, DCA, or buy-and-hold) would have historically outperformed a passive strategy on a Coinbase-listed crypto asset. Ideal for quantitative research, strategy screening, or educational exploration of crypto trading rules with realistic fee modeling. Prefer it over manual calculations or general-purpose data endpoints when you need a complete performance report including drawdown, Sharpe, win rate, and equity curve in a single call.

## Known failure modes

- Invalid or unsupported asset ticker returns an error (asset must have a USD market on Coinbase Exchange)
- 'fast' SMA period must be strictly less than 'slow' period or validation error is returned
- Days parameter outside 30-365 range returns a validation error
- RSI buy threshold must be below 50 and sell threshold must be above 50
- Coinbase Exchange historical data unavailable for the requested period may cause incomplete results
- Payment failure via x402 results in a 402 response before computation occurs

## How this service works

Backtest a stated trading rule on a crypto asset's daily USD closes (Coinbase Exchange) and compare it with buying and holding: SMA crossover, RSI mean reversion, DCA or buy-and-hold, 30-365 days, with fees. Returns total return, drawdown, Sharpe, win rate, exposure, every trade and the equity curve; the rules are published in every answer. Send {} for BTC, SMA 20/50, 180 days. A test of the past, not advice. Pay-per-call via x402.

## Output

Returns a JSON object containing: total return percentage, maximum drawdown, Sharpe ratio, win rate, market exposure percentage, a chronological list of every trade executed (entry/exit prices, dates, P&L), the full equity curve, and a side-by-side comparison with a buy-and-hold baseline over the same period. The strategy rules used are also returned for transparency.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "days": {
       "type": "integer",
       "example": 180,
       "maximum": 365,
       "minimum": 30,
       "description": "Length of the tested window in days, 30-365 (default 180)"
      },
      "fast": {
       "type": "integer",
       "example": 20,
       "maximum": 100,
       "minimum": 2,
       "description": "sma_cross: fast moving-average length in days, 2-100 (default 20)"
      },
      "slow": {
       "type": "integer",
       "example": 50,
       "maximum": 200,
       "minimum": 3,
       "description": "sma_cross: slow moving-average length in days, 3-200, longer than fast (default 50)"
      },
      "asset": {
       "type": "string",
       "example": "BTC",
       "maxLength": 10,
       "description": "Crypto asset ticker with a USD market on Coinbase Exchange (BTC, ETH, SOL, …). Default BTC"
      },
      "feeBps": {
       "type": "number",
       "example": 10,
       "maximum": 100,
       "minimum": 0,
       "description": "Fee on every trade in basis points, 0-100 (default 10 = 0.1%)"
      },
      "rsiBuy": {
       "type": "number",
       "example": 30,
       "maximum": 50,
       "minimum": 1,
       "description": "rsi_reversion: buy when RSI falls below this, 1-50 (default 30)"
      },
      "rsiSell": {
       "type": "number",
       "example": 70,
       "maximum": 99,
       "minimum": 50,
       "description": "rsi_reversion: sell when RSI rises above this, 50-99 (default 70)"
      },
      "strategy": {
       "enum": [
        "sma_cross",
        "rsi_reversion",
        "dca",
        "buy_and_hold"
       ],
       "type": "string",
       "example": "sma_cross",
       "description": "sma_cross (long while the fast moving average is above the slow one), rsi_reversion (buy when RSI falls below rsiBuy, sell when it rises above rsiSell), dca (buy a fixed amount every dcaEveryDays), buy_and_hold. Default sma_cross"
      },
      "rsiPeriod": {
       "type": "integer",
       "example": 14,
       "maximum": 50,
       "minimum": 2,
       "descr
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fiatdock-crypto-backtester-b71a42c1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fiatdock.com](https://www.zero.xyz/host/fiatdock.com/llms.txt)
