{
  "openapi": "3.0.3",
  "info": {
    "title": "Deep Blue Alpha API",
    "version": "1.1.0",
    "description": "Ethereum whale intelligence: live moves from 20,000+ tracked Ethereum whale wallets, each labelled as a DEX trade or a centralized-exchange deposit/withdrawal, per-token whale flow, a whale leaderboard and a daily 0-100 Whale Sentiment Index. Three endpoints are free with no key; the full API (25,000 requests/day) is included with the Whale plan for personal use. Commercial use: the Business plan ($299/mo or $2,990/yr) gives 250,000 requests/day across up to 5 keys plus signed real-time webhooks and daily data files \u2014 https://deepbluealpha.io/business. On-chain data, not financial advice.",
    "contact": {
      "name": "Deep Blue Alpha",
      "email": "team@deepbluealpha.io",
      "url": "https://deepbluealpha.io/api-docs"
    },
    "termsOfService": "https://deepbluealpha.io/terms",
    "x-logo": {
      "url": "https://deepbluealpha.io/static/img/main-logo-128.png"
    }
  },
  "externalDocs": {
    "description": "API docs",
    "url": "https://deepbluealpha.io/api-docs"
  },
  "servers": [
    {
      "url": "https://deepbluealpha.io"
    }
  ],
  "tags": [
    {
      "name": "Public (no key)",
      "description": "Free, CORS-enabled, cached 60s"
    },
    {
      "name": "Whale tier",
      "description": "Requires an API key from a Whale-plan or Business-plan account (deepbluealpha.io/account)"
    },
    {
      "name": "Business plan",
      "description": "Requires an active Business plan (deepbluealpha.io/business)"
    }
  ],
  "paths": {
    "/api/v1/public/whale-index": {
      "get": {
        "tags": [
          "Public (no key)"
        ],
        "operationId": "getPublicWhaleIndex",
        "security": [],
        "summary": "Whale Sentiment Index (free, no key)",
        "description": "Today's 0-100 Whale Sentiment Index for tracked Ethereum whale wallets plus ~30 days of history. CORS-enabled, cached 60s.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhaleIndex"
                }
              }
            }
          },
          "503": {
            "description": "Index temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/top-tokens": {
      "get": {
        "tags": [
          "Public (no key)"
        ],
        "operationId": "getPublicTopTokens",
        "security": [],
        "summary": "Top 10 tokens by tracked whale volume, last 24h (free, no key)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "window": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "symbol": {
                            "type": "string"
                          },
                          "volume_usd": {
                            "type": "number"
                          },
                          "trades": {
                            "type": "integer"
                          },
                          "buy_volume_usd": {
                            "type": "number",
                            "description": "Accumulation-side USD"
                          },
                          "sell_volume_usd": {
                            "type": "number",
                            "description": "Distribution-side USD"
                          },
                          "net_flow_usd": {
                            "type": "number"
                          },
                          "whales": {
                            "type": "integer"
                          },
                          "detail_url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/stats": {
      "get": {
        "tags": [
          "Public (no key)"
        ],
        "operationId": "getPublicStats",
        "security": [],
        "summary": "Coverage and 24h whale-flow totals (free, no key)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "as_of_utc": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tracked_wallets": {
                          "type": "integer"
                        },
                        "tracked_tokens": {
                          "type": "integer"
                        },
                        "transactions_total": {
                          "type": "integer"
                        },
                        "latest_transaction_utc": {
                          "type": "string"
                        },
                        "window_24h": {
                          "type": "object",
                          "properties": {
                            "buy_volume_usd": {
                              "type": "number"
                            },
                            "sell_volume_usd": {
                              "type": "number"
                            },
                            "distinct_buyers": {
                              "type": "integer"
                            },
                            "dex_swap_volume_usd": {
                              "type": "number"
                            },
                            "exchange_withdrawal_volume_usd": {
                              "type": "number"
                            },
                            "exchange_deposit_volume_usd": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "license": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/whale-index": {
      "get": {
        "tags": [
          "Whale tier"
        ],
        "operationId": "getWhaleIndex",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyQuery": []
          }
        ],
        "summary": "Whale Sentiment Index",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WhaleIndex"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Meta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Endpoint requires the Whale tier",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily rate limit reached (resets at UTC midnight)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/top-tokens": {
      "get": {
        "tags": [
          "Whale tier"
        ],
        "operationId": "getTopTokens",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyQuery": []
          }
        ],
        "summary": "Per-token net whale flow (stablecoins excluded)",
        "parameters": [
          {
            "name": "tf",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1H",
                "24H",
                "7D"
              ],
              "default": "24H"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "timeframe": {
                          "type": "string"
                        },
                        "tokens": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "symbol": {
                                "type": "string"
                              },
                              "net_flow_usd": {
                                "type": "number"
                              },
                              "buy_volume_usd": {
                                "type": "number"
                              },
                              "sell_volume_usd": {
                                "type": "number"
                              },
                              "trades": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Meta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Endpoint requires the Whale tier",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily rate limit reached (resets at UTC midnight)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/top-wallets": {
      "get": {
        "tags": [
          "Whale tier"
        ],
        "operationId": "getTopWallets",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyQuery": []
          }
        ],
        "summary": "Whale wallet leaderboard",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "wallets": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "rank": {
                                "type": "integer"
                              },
                              "volume_usd": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Meta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Endpoint requires the Whale tier",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily rate limit reached (resets at UTC midnight)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/transactions": {
      "get": {
        "tags": [
          "Whale tier"
        ],
        "operationId": "getTransactions",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyQuery": []
          }
        ],
        "summary": "Recent whale moves, newest first",
        "description": "Each move is labelled by `action`: SWAP_BUY / SWAP_SELL (DEX trades) or CEX_WITHDRAW / CEX_DEPOSIT (exchange transfers). Paginate with before_id.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "before_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Return moves with id below this (use next_before_id)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "transactions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "tx_hash": {
                                "type": "string"
                              },
                              "wallet": {
                                "type": "string"
                              },
                              "token": {
                                "type": "string"
                              },
                              "direction": {
                                "type": "string",
                                "description": "BUY (accumulation side) or SELL (distribution side)"
                              },
                              "action": {
                                "type": "string",
                                "enum": [
                                  "SWAP_BUY",
                                  "SWAP_SELL",
                                  "CEX_WITHDRAW",
                                  "CEX_DEPOSIT",
                                  "SELF_TRANSFER"
                                ]
                              },
                              "usd_value": {
                                "type": "number"
                              },
                              "timestamp": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          }
                        },
                        "next_before_id": {
                          "type": "integer"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Meta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Endpoint requires the Whale tier",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily rate limit reached (resets at UTC midnight)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/token/{symbol}/flow": {
      "get": {
        "tags": [
          "Whale tier"
        ],
        "operationId": "getTokenFlow",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyQuery": []
          }
        ],
        "summary": "One token's whale flow over 24h, 7d and 30d",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "LINK"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "symbol": {
                          "type": "string"
                        },
                        "windows": {
                          "type": "object",
                          "properties": {
                            "24h": {
                              "type": "object",
                              "properties": {
                                "net_flow_usd": {
                                  "type": "number",
                                  "description": "Accumulation-side minus distribution-side USD (exchange withdrawals + DEX buys minus deposits + DEX sells)"
                                },
                                "buy_volume_usd": {
                                  "type": "number",
                                  "description": "Accumulation-side USD (DEX buys + exchange withdrawals)"
                                },
                                "sell_volume_usd": {
                                  "type": "number",
                                  "description": "Distribution-side USD (DEX sells + exchange deposits)"
                                },
                                "trades": {
                                  "type": "integer",
                                  "description": "Number of whale moves"
                                },
                                "wallets": {
                                  "type": "integer",
                                  "description": "Distinct whale wallets"
                                },
                                "dex_buy_usd": {
                                  "type": "number"
                                },
                                "dex_sell_usd": {
                                  "type": "number"
                                },
                                "exchange_withdraw_usd": {
                                  "type": "number",
                                  "description": "Coins pulled off centralized exchanges"
                                },
                                "exchange_deposit_usd": {
                                  "type": "number",
                                  "description": "Coins sent to centralized exchanges"
                                }
                              }
                            },
                            "7d": {
                              "type": "object",
                              "properties": {
                                "net_flow_usd": {
                                  "type": "number",
                                  "description": "Accumulation-side minus distribution-side USD (exchange withdrawals + DEX buys minus deposits + DEX sells)"
                                },
                                "buy_volume_usd": {
                                  "type": "number",
                                  "description": "Accumulation-side USD (DEX buys + exchange withdrawals)"
                                },
                                "sell_volume_usd": {
                                  "type": "number",
                                  "description": "Distribution-side USD (DEX sells + exchange deposits)"
                                },
                                "trades": {
                                  "type": "integer",
                                  "description": "Number of whale moves"
                                },
                                "wallets": {
                                  "type": "integer",
                                  "description": "Distinct whale wallets"
                                },
                                "dex_buy_usd": {
                                  "type": "number"
                                },
                                "dex_sell_usd": {
                                  "type": "number"
                                },
                                "exchange_withdraw_usd": {
                                  "type": "number",
                                  "description": "Coins pulled off centralized exchanges"
                                },
                                "exchange_deposit_usd": {
                                  "type": "number",
                                  "description": "Coins sent to centralized exchanges"
                                }
                              }
                            },
                            "30d": {
                              "type": "object",
                              "properties": {
                                "net_flow_usd": {
                                  "type": "number",
                                  "description": "Accumulation-side minus distribution-side USD (exchange withdrawals + DEX buys minus deposits + DEX sells)"
                                },
                                "buy_volume_usd": {
                                  "type": "number",
                                  "description": "Accumulation-side USD (DEX buys + exchange withdrawals)"
                                },
                                "sell_volume_usd": {
                                  "type": "number",
                                  "description": "Distribution-side USD (DEX sells + exchange deposits)"
                                },
                                "trades": {
                                  "type": "integer",
                                  "description": "Number of whale moves"
                                },
                                "wallets": {
                                  "type": "integer",
                                  "description": "Distinct whale wallets"
                                },
                                "dex_buy_usd": {
                                  "type": "number"
                                },
                                "dex_sell_usd": {
                                  "type": "number"
                                },
                                "exchange_withdraw_usd": {
                                  "type": "number",
                                  "description": "Coins pulled off centralized exchanges"
                                },
                                "exchange_deposit_usd": {
                                  "type": "number",
                                  "description": "Coins sent to centralized exchanges"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Meta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Endpoint requires the Whale tier",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily rate limit reached (resets at UTC midnight)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing token symbol",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/watchlist": {
      "get": {
        "tags": [
          "Whale tier"
        ],
        "operationId": "getWatchlist",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyQuery": []
          }
        ],
        "summary": "The key owner's watchlist with 7-day metrics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "wallets": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "tokens": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Meta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Endpoint requires the Whale tier",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily rate limit reached (resets at UTC midnight)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/data/files": {
      "get": {
        "tags": [
          "Business plan"
        ],
        "operationId": "listDailyFiles",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyQuery": []
          },
          {
            "SessionCookie": []
          }
        ],
        "summary": "List daily data files (Business plan)",
        "description": "Requires an active Business plan (API key or signed-in session). One set of files per UTC day of moves by tracked Ethereum whale wallets: dba_whale_moves_YYYY-MM-DD.csv.gz and .jsonl.gz, dba_token_totals_YYYY-MM-DD.csv.gz and dba_manifest_YYYY-MM-DD.json. History from 2026-10-07; the last 90 days are kept. An API-key call counts toward the daily API limit.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "history_start": {
                      "type": "string",
                      "format": "date"
                    },
                    "retention_days": {
                      "type": "integer"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "days": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "rows": {
                            "type": "integer"
                          },
                          "exchange_rows": {
                            "type": "integer"
                          },
                          "dex_rows": {
                            "type": "integer"
                          },
                          "tokens": {
                            "type": "integer"
                          },
                          "generated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "manifest": {
                            "type": "string"
                          },
                          "files": {
                            "type": "object",
                            "properties": {
                              "moves_csv": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "bytes": {
                                    "type": "integer"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                }
                              },
                              "moves_jsonl": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "bytes": {
                                    "type": "integer"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                }
                              },
                              "totals_csv": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "bytes": {
                                    "type": "integer"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                }
                              },
                              "manifest": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "bytes": {
                                    "type": "integer"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or missing/invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Needs an active Business plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily rate limit reached (resets at UTC midnight)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/data/files/{name}": {
      "get": {
        "tags": [
          "Business plan"
        ],
        "operationId": "downloadDailyFile",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyQuery": []
          },
          {
            "SessionCookie": []
          }
        ],
        "summary": "Download one daily data file (Business plan)",
        "description": "Requires an active Business plan. `name` must be a file name listed by GET /data/files.",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "dba_whale_moves_2026-10-15.csv.gz"
          }
        ],
        "responses": {
          "200": {
            "description": "The file (application/gzip for .csv.gz / .jsonl.gz, application/json for a manifest)",
            "content": {
              "application/gzip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "File not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or missing/invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Needs an active Business plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily rate limit reached (resets at UTC midnight)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/business/webhooks": {
      "post": {
        "tags": [
          "Business plan"
        ],
        "operationId": "createBusinessWebhook",
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "summary": "Add a real-time webhook endpoint (Business plan)",
        "description": "Requires an active Business plan and a signed-in session (webhooks are managed from deepbluealpha.io/account). The signing secret is returned once. Each new move by a tracked whale wallet is POSTed to every matching endpoint as JSON: `{type: \"whale_move\", event_id, api_version, time_utc, tx_hash, wallet, token, action, usd_value, venue_type, flow}`. Headers: `X-DBA-Event-Id`, `X-DBA-Timestamp`, `X-DBA-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>`. venue_type=exchange rows (CEX_WITHDRAW / CEX_DEPOSIT) are transfers to or from an exchange, not purchases or sales; only venue_type=dex rows are swaps. Failed deliveries are retried with backoff and events can arrive out of order: dedupe on event_id and order on time_utc. The daily data files are the complete record.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Public https:// endpoint (redirects are not followed; private/internal addresses are refused)"
                  },
                  "label": {
                    "type": "string",
                    "description": "Up to 60 characters"
                  },
                  "min_usd": {
                    "type": "number",
                    "description": "Only moves at or above this USD value (0 = all)"
                  },
                  "tokens": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Token symbols to include (empty = all)"
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "CEX_WITHDRAW",
                        "CEX_DEPOSIT",
                        "SWAP_BUY",
                        "SWAP_SELL"
                      ]
                    },
                    "description": "Move types to include (empty = all)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "url_masked": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "min_usd": {
                          "type": "number"
                        },
                        "tokens": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "disabled_reason": {
                          "type": "string"
                        },
                        "consecutive_failures": {
                          "type": "integer"
                        },
                        "delivered_count": {
                          "type": "integer"
                        },
                        "failed_count": {
                          "type": "integer"
                        },
                        "last_success_at": {
                          "type": "string"
                        },
                        "last_failure_at": {
                          "type": "string"
                        },
                        "last_error": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        }
                      }
                    },
                    "secret": {
                      "type": "string",
                      "description": "Signing secret, shown once"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid URL or filters, or webhook limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many new webhooks in the last hour",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Needs an active Business plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/business/webhooks/{hook_id}/update": {
      "post": {
        "tags": [
          "Business plan"
        ],
        "operationId": "updateBusinessWebhook",
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "summary": "Change a webhook's filters or label, or pause/resume it (Business plan)",
        "parameters": [
          {
            "name": "hook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "description": "Up to 60 characters"
                  },
                  "min_usd": {
                    "type": "number",
                    "description": "Only moves at or above this USD value (0 = all)"
                  },
                  "tokens": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Token symbols to include (empty = all)"
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "CEX_WITHDRAW",
                        "CEX_DEPOSIT",
                        "SWAP_BUY",
                        "SWAP_SELL"
                      ]
                    },
                    "description": "Move types to include (empty = all)"
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "false pauses, true resumes"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "url_masked": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "min_usd": {
                          "type": "number"
                        },
                        "tokens": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "disabled_reason": {
                          "type": "string"
                        },
                        "consecutive_failures": {
                          "type": "integer"
                        },
                        "delivered_count": {
                          "type": "integer"
                        },
                        "failed_count": {
                          "type": "integer"
                        },
                        "last_success_at": {
                          "type": "string"
                        },
                        "last_failure_at": {
                          "type": "string"
                        },
                        "last_error": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Needs an active Business plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/business/webhooks/{hook_id}/rotate-secret": {
      "post": {
        "tags": [
          "Business plan"
        ],
        "operationId": "rotateBusinessWebhookSecret",
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "summary": "Issue a new signing secret, returned once (Business plan)",
        "parameters": [
          {
            "name": "hook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "secret": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Needs an active Business plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/business/webhooks/{hook_id}/test": {
      "post": {
        "tags": [
          "Business plan"
        ],
        "operationId": "testBusinessWebhook",
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "summary": "Send one signed test event now (Business plan)",
        "parameters": [
          {
            "name": "hook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "http_status": {
                      "type": "integer"
                    },
                    "error": {
                      "type": "string"
                    },
                    "event_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Needs an active Business plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/business/webhooks/{hook_id}/delete": {
      "post": {
        "tags": [
          "Business plan"
        ],
        "operationId": "deleteBusinessWebhook",
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "summary": "Delete a webhook endpoint (Business plan)",
        "parameters": [
          {
            "name": "hook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Needs an active Business plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/business/webhooks/{hook_id}/deliveries": {
      "get": {
        "tags": [
          "Business plan"
        ],
        "operationId": "listBusinessWebhookDeliveries",
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "summary": "Recent delivery results for one webhook (Business plan)",
        "parameters": [
          {
            "name": "hook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event_id": {
                            "type": "string"
                          },
                          "outcome": {
                            "type": "string"
                          },
                          "attempts": {
                            "type": "integer"
                          },
                          "http_status": {
                            "type": "integer"
                          },
                          "error_class": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Needs an active Business plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "ApiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key"
      },
      "SessionCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "dba_token",
        "description": "Signed-in deepbluealpha.io session (webhooks are managed from the account page)"
      }
    },
    "schemas": {
      "Meta": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "string",
            "description": "Tier of the key owner, e.g. whale"
          },
          "endpoint": {
            "type": "string"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable error message"
          }
        }
      },
      "WhaleIndex": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "score": {
            "type": "integer",
            "description": "0-100. 50 is a typical day; above leans accumulation, below leans distribution"
          },
          "label": {
            "type": "string",
            "description": "e.g. Neutral, Slightly Bullish"
          },
          "stale": {
            "type": "boolean"
          },
          "score_method": {
            "type": "string",
            "description": "composite (risk appetite, exchange flow, breadth, each ranked vs ~45 days)"
          },
          "whale_moves": {
            "type": "integer"
          },
          "total_volume_usd": {
            "type": "number"
          },
          "active_wallets": {
            "type": "integer"
          },
          "dex_pct": {
            "type": "number",
            "description": "Share of directional events that were DEX trades"
          },
          "cex_pct": {
            "type": "number",
            "description": "Share that were exchange deposits/withdrawals"
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "score": {
                  "type": "integer"
                }
              }
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}