{
  "openapi": "3.0.3",
  "info": {
    "title": "Depth Radar API",
    "version": "1.0.0",
    "description": "Free crypto order-flow data: multi-venue CVD, footprint, order-book liquidity, divergences and long-horizon Bitcoin models. No auth, open CORS, rate limit 10 req/s per IP (burst 30, then 429). MCP server for agents: POST https://app.depthradar.com/mcp (Streamable HTTP, stateless). Docs: https://app.depthradar.com/api.html",
    "contact": { "url": "https://t.me/depthradar" }
  },
  "servers": [{ "url": "https://app.depthradar.com" }],
  "components": {
    "parameters": {
      "sym": {
        "name": "sym", "in": "query", "required": false,
        "schema": { "type": "string", "enum": ["BTCUSDT", "ETHUSDT"], "default": "BTCUSDT" },
        "description": "Trading pair"
      }
    }
  },
  "paths": {
    "/api/ticker": {
      "get": {
        "summary": "Market snapshot: BTC/ETH price, 24h stats, funding, Fear & Greed, BTC dominance, open interest",
        "responses": { "200": { "description": "Snapshot", "content": { "application/json": {} } } }
      }
    },
    "/api/live": {
      "get": {
        "summary": "Current 1m bar: OHLC, volume, five-venue CVD (coin units), open interest",
        "parameters": [{ "$ref": "#/components/parameters/sym" }],
        "responses": { "200": { "description": "Live bar. CVD fields: cvdBinance/cvdBybit (USDT-perp), cvdBnC (Binance coin-margined), cvdByC (Bybit inverse), cvdCb (Coinbase spot)", "content": { "application/json": {} } } }
      }
    },
    "/api/history": {
      "get": {
        "summary": "1m bars with per-venue CVD and open interest series (~3 days retained)",
        "parameters": [{ "$ref": "#/components/parameters/sym" }],
        "responses": { "200": { "description": "Bars + OI series", "content": { "application/json": {} } } }
      }
    },
    "/api/divergences": {
      "get": {
        "summary": "Confirmed price-CVD divergences for BTC and ETH (1m swings, non-repainting)",
        "responses": { "200": { "description": "Rows: {t, sym, type: 'div+'|'div-', price, cvd}", "content": { "application/json": {} } } }
      }
    },
    "/api/liqzones": {
      "get": {
        "summary": "Largest resting order-book walls over a lookback window",
        "parameters": [
          { "$ref": "#/components/parameters/sym" },
          { "name": "mins", "in": "query", "schema": { "type": "integer", "minimum": 5, "maximum": 10080, "default": 180 }, "description": "Lookback minutes" },
          { "name": "top", "in": "query", "schema": { "type": "integer", "minimum": 3, "maximum": 40, "default": 14 }, "description": "Max zones" }
        ],
        "responses": { "200": { "description": "Zones: {price, qty, from, to, touched}", "content": { "application/json": {} } } }
      }
    },
    "/api/heatmap": {
      "get": {
        "summary": "Order-book depth matrix over time + liquidations + previous-day levels",
        "parameters": [
          { "$ref": "#/components/parameters/sym" },
          { "name": "mins", "in": "query", "schema": { "type": "integer", "minimum": 5, "maximum": 10080, "default": 60 } },
          { "name": "cols", "in": "query", "schema": { "type": "integer", "minimum": 30, "maximum": 400, "default": 240 } },
          { "name": "until", "in": "query", "schema": { "type": "integer" }, "description": "Unix ms; window end (default: now)" }
        ],
        "responses": { "200": { "description": "Depth columns, liqs, levels", "content": { "application/json": {} } } }
      }
    },
    "/api/footprint": {
      "get": {
        "summary": "Footprint bars: taker sell/buy volume at each price level inside candles, with OHLC and delta",
        "parameters": [
          { "$ref": "#/components/parameters/sym" },
          { "name": "tf", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 60, "default": 15 }, "description": "Candle minutes" },
          { "name": "tick", "in": "query", "schema": { "type": "number" }, "description": "Price bucket in USD (default: 2x storage tick)" }
        ],
        "responses": { "200": { "description": "Bars: {t, o, h, l, c, vol, delta, levels: [{p, a: buy, b: sell}]}", "content": { "application/json": {} } } }
      }
    },
    "/api/markets": {
      "get": {
        "summary": "Top-100 coins by 24h Binance spot volume",
        "responses": { "200": { "description": "Rows: {s, c: price, P: 24h %, q: quote volume}", "content": { "application/json": {} } } }
      }
    },
    "/api/model/btc": {
      "get": {
        "summary": "Bitcoin long-horizon models from daily closes since 2011: drawdown from ATH, risk 0-1 percentile, cycle comparison, power-law fit",
        "responses": { "200": { "description": "{t[], c[], dd[], risk[], majorDrawdowns, cycles, powerlaw, summary}", "content": { "application/json": {} } } }
      }
    }
  }
}
