Skip to content

OHLCV candles for one subnet

GET
/subnet-price-history/

Candles of one subnet’s alpha price in TAO per alpha, oldest first, each starting at time in UNIX seconds, with the TAO swapped through the pool during the bucket as volume. Widths run from 1 minute to 1 week (resolution), and weeks start on Monday. Without from, the newest limit candles up to to or now; with it, the oldest limit from it. On aggregated widths both bounds snap to bucket edges, so every candle covers its whole bucket.

Rate limit: 2000 requests per minute per IP (scope subnet_price).

Stable: the operation and its fields leave only after 180 days of notice.

  • None
from
string

Lower bound: an ISO date/datetime, or UNIX seconds (milliseconds above 1e12). An unparseable value is ignored, never a 400.

limit
integer

Maximum rows. Default per-resolution (365 at D, 720 at most minute widths), clamped to 10000. An unparseable value falls back to the default.

netuid
required
integer

Subnet netuid. 400 when missing or not an integer.

resolution
string
Allowed values: 1 15 240 30 5 60 D W

Candle width in minutes, or D/W. 400 on any other value. Default 60.

to
string

Upper bound, same formats as from. Without from, the page is the newest limit bars up to it.

The candles, oldest first; a bucket with no recorded price has none.

Media typeapplication/json
object
netuid
required
integer
resolution
required

The candle width: 1, 5, 15, 30, 60 or 240 minutes, D or W.

string
count
required

Candles in results.

integer
results
required

Oldest first. A bucket with no recorded price has no candle.

Array<object>
object
time
required

In UNIX seconds. The start of the bucket: days start at 00:00 UTC, weeks on Monday.

integer
open
required

In TAO per alpha. The price at the bucket’s open, the previous candle’s close.

number format: double
high
required

In TAO per alpha. The highest price during the bucket.

number format: double
low
required

In TAO per alpha. The lowest price during the bucket.

number format: double
close
required

In TAO per alpha. The price at the bucket’s close; the newest candle can still be open.

number format: double
volume
required

In TAO. Swap volume through the subnet’s pool during the bucket, buys and sells added together.

number format: double

Examples

ExampleSubnetPriceHistory

Two daily candles of subnet 64

{
"netuid": 64,
"resolution": "D",
"count": 2,
"results": [
{
"time": 1792627200,
"open": 0.067109159,
"high": 0.068240326,
"low": 0.067109083,
"close": 0.067867348,
"volume": 6549.837576187999
},
{
"time": 1792713600,
"open": 0.067867348,
"high": 0.068061833,
"low": 0.067867272,
"close": 0.068039508,
"volume": 398.21830664600003
}
]
}

A parameter failed its check, which message names. code is usually VALIDATION_ERROR.

Media typeapplication/json

The error envelope every 4xx and 5xx response carries. The introduction lists the code values.

object
error
required

Always true. Lets a client branch without reading the status code.

boolean
code
required

Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.

string
message
required

One human-readable sentence.

string
detail
required

Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.

nullable

Examples

ExampleVALIDATIONERROR

VALIDATION_ERROR

{
"error": true,
"code": "VALIDATION_ERROR",
"message": "netuid is required",
"detail": null
}

Rate limit exceeded (2000/minute, per IP). Retry-After carries the seconds to wait.

Media typeapplication/json

The error envelope every 4xx and 5xx response carries. The introduction lists the code values.

object
error
required

Always true. Lets a client branch without reading the status code.

boolean
code
required

Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.

string
message
required

One human-readable sentence.

string
detail
required

Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.

nullable

Examples

ExampleRATELIMITED

RATE_LIMITED

{
"error": true,
"code": "RATE_LIMITED",
"message": "Request was throttled",
"detail": {
"retry_after": 12
}
}
Retry-After
integer

Seconds before the next request is accepted.

QUERY_TIMEOUT: the query exceeded its budget. detail carries budget_ms, elapsed_ms, path and query.

Media typeapplication/json

The error envelope every 4xx and 5xx response carries. The introduction lists the code values.

object
error
required

Always true. Lets a client branch without reading the status code.

boolean
code
required

Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.

string
message
required

One human-readable sentence.

string
detail
required

Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.

nullable

Examples

ExampleQUERYTIMEOUT

QUERY_TIMEOUT

{
"error": true,
"code": "QUERY_TIMEOUT",
"message": "query exceeded the 12000 ms budget; retry, or narrow the requested range",
"detail": {
"budget_ms": 12000,
"elapsed_ms": 12004,
"path": "/trades/summary/",
"query": "coldkey=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY&resolution=day"
}
}