---
title: "Deribit BTC Max Pain — historical expiries"
method: GET
path: "/api/v1/onchain/max-pain/history"
tags: ["On-Chain"]
---

# Deribit BTC Max Pain — historical expiries

`GET /api/v1/onchain/max-pain/history`

## Request

- Base URL: `https://tradingstrategies.work`
- URL: `https://tradingstrategies.work/api/v1/onchain/max-pain/history`
- Auth: HTTP bearer

History of finalized Deribit BTC options expiries in one call — a complete base rate, not a page. Each row: expiry_date, max_pain_strike, spot_at_expiry, %-diff, put_call_ratio, notional, total_contracts here is the open interest at the LAST daily snapshot BEFORE expiry -- the same measurement as open_interest_contracts on upcoming expiries, only observed at a different time. contracts_as_of names the snapshot the contracts came from -- equal to expiry_date in all 64 measured rows, so contracts and settlement price are same-day; the field makes a future gap visible. is_quarterly, is_monthly (the latter two corrected 2026-07-30 — they previously marked a 7-day window rather than the last-Friday expiry). spot_at_expiry = Deribit delivery price (30-min index TWAP before 08:00 UTC); rows before 2026-08-31 were recomputed from that series (they had carried the BTCUSDT daily close), so base rates computed before that date differ. Days capped by tier: Pro 365d, Power 3650d. [API Pro tier]

## Query parameters

- `days` integer
- `market` 'DERIBIT_BTC'
- `expiry_type` 'daily' | 'weekly' | 'monthly' | 'quarterly'
- `min_contracts` integer
- `snapshot_expiry_date` string, date
- `include_open_snapshots` boolean

## Response `200`

Historical max-pain expiry records + mandatory base_rates per expiry class (n, median |diff|, shares within 1%/2%, max, sample_adequate at n>=30 — present even at n=0) + filters block.

## Other responses

- `400`: Invalid input — fehlt Pflichtfeld oder Wert außerhalb des erlaubten Bereichs.
- `401`: Unauthenticated — kein gültiger Bearer-Token im Authorization-Header.
- `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)
