Skip to main content
API referenceSubnets

Subnet OHLC

Last updated

GET
/api/v1/subnets/{netuid}/ohlc

Fetch open/high/low/close/volume candles for one subnet's alpha price, bucketed by ?interval= (1h or 1d, default 1h) from the same account_events StakeAdded/StakeRemoved stream as GET /api/v1/subnets/{netuid}/volume — each row is one executed trade, price = amount_tao / alpha_amount. Open/high/low/close are the first/max/min/last trade price in the bucket; volume_alpha/volume_tao are summed amounts. ?days= bounds the lookback window (default 90, max 365). Empty buckets are omitted (a gap, not a synthesized flat candle). The root subnet (netuid 0) has no AMM pool — 1:1 TAO, no price impact — so it returns an empty candle array with root_excluded:true rather than a meaningless flat-line series.

Path Parameters

netuid*integer

The subnet's numeric id on the Bittensor network, as used by the chain itself.

Range0 <= value

Query Parameters

interval?string
Default"1h"

Value in

  • "1h"
  • "1d"
days?integer

How many days of history to return; defaults to 90.

Range1 <= value <= 365
Default90
limit?integer

Maximum number of rows to return in one page (at most 2000). A larger value, or a non-positive one, is rejected with 400 invalid_query -- so a short page means the result set is exhausted, not that the server quietly capped you (#9916). Omitted, the server applies 2000.

Range1 <= value <= 2000
Default2000

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/subnets/1/ohlc"
{  "data": {    "candle_count": 1,    "candles": [      {        "bucket_start": 1,        "bucket_start_iso": "2026-06-01T00:00:00.000Z",        "close": 0.5,        "event_count": 1,        "high": 0.5,        "low": 0.5,        "open": 0.5,        "volume_alpha": 0.5,        "volume_tao": 0.5      }    ],    "degraded": {      "reason": "unavailable"    },    "field_sources_usd": {      "kind": "reconstructed",      "storage": null    },    "interval": "1h",    "netuid": 7,    "priced_candle_count": 1,    "root_excluded": false,    "schema_version": 1,    "usd_available_from": 1,    "usd_available_from_iso": "2026-06-01T00:00:00.000Z",    "usd_unavailable": "no_index_reading",    "window_truncated": false  },  "meta": {    "artifact_path": "example",    "cache": "short",    "contract_version": "2026-06-29.1",    "generated_at": "2026-06-01T00:00:00.000Z",    "observed_through": "2026-06-01T00:00:00.000Z",    "pagination": {      "collection": "example",      "cursor": 1,      "limit": 1,      "next_cursor": 1,      "order": "asc",      "returned": 1,      "sort": "example",      "total": 1    },    "published_at": "2026-06-01T00:00:00.000Z",    "source": "live-cron-prober",    "stale_contract": {      "built_under": "example",      "live": "example"    }  },  "ok": true,  "schema_version": 1}