---
title: "Daily market data"
method: GET
path: "/api/market-data"
tags: ["Market data"]
---

# Daily market data

`GET /api/market-data`

## Request

- Base URL: `https://market-api.metadao.fi/v1`
- URL: `https://market-api.metadao.fi/v1/api/market-data`
- Auth: one of:
  - none
  - API key in header `X-API-Key`
- TypeScript: <https://skmtc.dev/metadao/apis/futarchy-external-api/docs/api/market-data/get.ts> (a function with typed inputs; its response is checked against the schema)

Daily FutarchyAMM (spot, conditional and total) and Meteora activity per token over an inclusive date range. Parameters are validated before the database is touched, so a bad request is always 400.

## Query parameters

- `startDate` string, date, required
- `endDate` string, date, required
- `tokens` string

## Response `200`

Daily market data.

- MarketDataResponse
  - `filters` object, required
    - `tokens` union, required: The requested token list, or the string "all" when no filter was given.
      - 'all'
      - string[]
    - `startDate` string, date, required
    - `endDate` string, date, required
  - `source` 'user-pool-etl', required
  - `futarchyAMM` object, required
    - `source` 'etl-user-pool-daily', required
    - `count` integer, required
    - `data` FutarchyAmmDailyActivity[], required
      - `token` string, required: Base token mint.
      - `date` string, date, required: UTC day (YYYY-MM-DD).
      - `has_conditional_volume` boolean, required: True when the day has a conditional-market row.
      - `spot_buy_volume` string, required: Spot market: Buy-side volume (quote/USD). Decimal string in human units.
      - `spot_sell_volume` string, required: Spot market: Sell-side volume (quote/USD). Decimal string in human units.
      - `spot_base_volume` string, required: Spot market: Volume in the base token. Decimal string in human units.
      - `spot_target_volume` string, required: Spot market: Volume in the quote token (USD). Decimal string in human units.
      - `spot_usdc_fees` string, required: Spot market: Fees collected in USDC. Decimal string in human units.
      - `spot_token_fees` string, required: Spot market: Fees collected in the base token. Decimal string in human units.
      - `spot_token_fees_usdc` string, required: Spot market: Base-token fees valued in USDC. Decimal string in human units.
      - `spot_protocol_fee_usd` string, required: Spot market: Protocol fee portion (USD), collected to the treasury. Decimal string in human units.
      - `spot_lp_fee_usd` string, required: Spot market: LP fee portion (USD), retained in the pool. Decimal string in human units.
      - `spot_trade_count` integer, required: Spot market trade count.
      - `conditional_buy_volume` string, nullable, required: Conditional markets: Buy-side volume (quote/USD). Decimal string in human units; null when the day had no conditional-market row.
      - `conditional_sell_volume` string, nullable, required: Conditional markets: Sell-side volume (quote/USD). Decimal string in human units; null when the day had no conditional-market row.
      - `conditional_base_volume` string, nullable, required: Conditional markets: Volume in the base token. Decimal string in human units; null when the day had no conditional-market row.
      - `conditional_target_volume` string, nullable, required: Conditional markets: Volume in the quote token (USD). Decimal string in human units; null when the day had no conditional-market row.
      - `conditional_usdc_fees` string, nullable, required: Conditional markets: Fees collected in USDC. Decimal string in human units; null when the day had no conditional-market row.
      - `conditional_token_fees` string, nullable, required: Conditional markets: Fees collected in the base token. Decimal string in human units; null when the day had no conditional-market row.
      - `conditional_token_fees_usdc` string, nullable, required: Conditional markets: Base-token fees valued in USDC. Decimal string in human units; null when the day had no conditional-market row.
      - `conditional_protocol_fee_usd` string, nullable, required: Conditional markets: Protocol fee portion (USD), collected to the treasury. Decimal string in human units; null when the day had no conditional-market row.
      - `conditional_lp_fee_usd` string, nullable, required: Conditional markets: LP fee portion (USD), retained in the pool. Decimal string in human units; null when the day had no conditional-market row.
      - `conditional_trade_count` integer, nullable, required: Conditional markets trade count; null when the day had no conditional-market row.
      - `total_buy_volume` string, required: Spot + conditional: Buy-side volume (quote/USD). Decimal string in human units.
      - `total_sell_volume` string, required: Spot + conditional: Sell-side volume (quote/USD). Decimal string in human units.
      - `total_base_volume` string, required: Spot + conditional: Volume in the base token. Decimal string in human units.
      - `total_target_volume` string, required: Spot + conditional: Volume in the quote token (USD). Decimal string in human units.
      - `total_usdc_fees` string, required: Spot + conditional: Fees collected in USDC. Decimal string in human units.
      - `total_token_fees` string, required: Spot + conditional: Fees collected in the base token. Decimal string in human units.
      - `total_token_fees_usdc` string, required: Spot + conditional: Base-token fees valued in USDC. Decimal string in human units.
      - `total_protocol_fee_usd` string, required: Spot + conditional: Protocol fee portion (USD), collected to the treasury. Decimal string in human units.
      - `total_lp_fee_usd` string, required: Spot + conditional: LP fee portion (USD), retained in the pool. Decimal string in human units.
      - `total_trade_count` integer, required: Spot + conditional trade count.
      - `conditional_reconciled` boolean, required: Whether conditional volume for the day has been reconciled.
      - `pending_open_proposals` integer, required: Open proposals whose conditional volume is still pending.
  - `meteora` object, required
    - `source` 'etl-meteora-daily', required
    - `count` integer, required
    - `data` MeteoraDailyVolume[], required
      - `token` string, required: Base token mint.
      - `date` string, date, required
      - `base_volume` string, required: Volume in the base token. Decimal string in human units.
      - `target_volume` string, required: Volume in USDC. Decimal string in human units.
      - `buy_volume` string, required: Buy-side volume. Decimal string in human units.
      - `sell_volume` string, required: Sell-side volume. Decimal string in human units.
      - `trade_count` integer, required
      - `average_price` string, required: Average price (USDC per token). Decimal string in human units.
      - `usdc_fees` string, required: Fees in USDC. Decimal string in human units.
      - `token_fees` string, required: Fees in the base token. Decimal string in human units.
      - `token_fees_usdc` string, required: Base-token fees valued in USDC. Decimal string in human units.
      - `token_per_usdc` string, nullable, required: base_volume / target_volume; null when target_volume is 0.

## Other responses

- `400`: Invalid request: `INVALID_MINT_ADDRESS` for a bad path address, `INVALID_QUERY_PARAMETER` for a missing, malformed or repeated query parameter. `field` names the parameter.
- `401`: Unknown `X-API-Key` (`INVALID_API_KEY`), or missing/invalid metrics bearer token on `/metrics`.
- `429`: Rate limit exceeded (`RATE_LIMITED`).
- `500`: Unexpected server or upstream (RPC/DB) failure. Retry later.
- `503`: A dependency is unavailable or its data is stale (e.g. `SERVED_DB_UNAVAILABLE`, `SERVED_DATA_STALE`) or the request timed out (`REQUEST_TIMEOUT`). Retry later.

---

[API](https://skmtc.dev/metadao/apis/futarchy-external-api.md) - [All operations](https://skmtc.dev/metadao/apis/futarchy-external-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metadao/apis/futarchy-external-api/revisions/27b09f0a2750?raw)
