Portfolio APY and PnL for one coldkey on one subnet
Deprecated: stops answering on 2027-01-06. Use /portfolio-pnl-apy/?include_subnets=true instead. One coldkey’s APY and PnL on one subnet. /portfolio-pnl-apy/?include_subnets=true serves the same entry for every subnet the coldkey holds, under subnets[]; read the one whose netuid you need.
The APY and PnL blocks of one coldkey on one subnet, as one entry of subnets[]. 404 when it has no data there.
Rate limit: 300 requests per minute per IP (scope explore).
Authorizations
Section titled “Authorizations”- None
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Coldkey SS58 address. 400 when missing or containing a NUL byte.
Subnet netuid. 400 when missing or not an integer.
Responses
Section titled “Responses”The coldkey’s APY and PnL on the subnet.
One coldkey on one subnet. 404 when it holds neither a row nor a dissolved occupant’s.
object
Null when the coldkey traded only this netuid’s dissolved occupants.
live: pnl was replayed at request time and marked at spot. snapshot: the nightly rows, served when the coldkey is too large to replay per request, the box-wide replay budget is spent, or the replay failed. Null when pnl is null.
This subnet’s returns, from the nightly snapshot. Null when it has none. On root (netuid 0) the position is the root stake plus the fund shares at what a claim would pay (root_rewards of /portfolio-balance/): alpha and tao are one rate wherever both are set, the funds’ value moves included. Stake moved in or out and share purchases are flows; a claim, which moves shares into the stake, is neither flow nor yield.
object
Percent per year, linear on a gain and compounded on a loss. The alpha earned on the alpha held, so no price move enters it.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
Percent per year, annualised like alpha. The return in TAO, subnet price moves included; globally the whole wallet’s, its alpha at each subnet’s end-of-day spot where value_change_tao reads what selling it would fetch.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
Percent per year, annualised like alpha. The return in USD, TAO/USD moves included.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
Days each window spans, from its first day holding at least 1 % of its peak to its last; the fewer, the less reliable the rates.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
In alpha rao, signed. The alpha gained over each window, net of what the coldkey bought, sold or moved; globally a sum across subnets.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
In rao, despite the name. The value gained over each window, signed, net of the coldkey’s own buys, sells and transfers.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
In USD, as signed decimal strings. The same gain in USD, TAO/USD moves included.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
In rao, despite the name. The net value the coldkey moved in, signed, at end prices; value_change_tao plus flow_tao is the gross change.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
In rao, despite the name. The wallet’s value on each window’s first day; value_change_tao over basis_tao is the window’s return.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
Percent, signed. Set even when the window holds too few days for tao.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
Percent, signed. Set even when the window holds too few days for usd.
object
The 7 days up to the day of apy_as_of.
The 30 days up to the day of apy_as_of.
The whole daily history up to the day of apy_as_of. No window spans a coldkey swap, nor on a subnet a new registration of its netuid.
This subnet’s profit and loss, its current occupant’s only. Null when there is none.
object
Booked over all time whenever alpha left a position: sold, refunded, swapped to another subnet, transferred or burned. Root stake books none.
object
In rao, signed: the figure in TAO, under each cost-basis method.
object
In rao, signed. Weighted average cost: what leaves a position takes its average cost.
In rao, signed. First in, first out: what leaves a position takes the cost of its oldest lots.
In USD, each trade at the TAO/USD of its hour, so the TAO/USD move during the hold counts.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
In USD: tao at the TAO/USD of the day it was computed, blind to the TAO/USD path during the hold.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
The alpha held, at its price at as_of, minus what it cost; staking rewards enter at zero cost. Root stake books none.
object
In rao, signed: the figure in TAO, under each cost-basis method.
object
In rao, signed. Weighted average cost: what leaves a position takes its average cost.
In rao, signed. First in, first out: what leaves a position takes the cost of its oldest lots.
In USD, each trade at the TAO/USD of its hour, so the TAO/USD move during the hold counts.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
In USD: tao at the TAO/USD of the day it was computed, blind to the TAO/USD path during the hold.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
unrealized with the alpha held at what selling it at as_of would pay: per subnet, all of it sold at once into its pool at constant product on the reserves, no fee, the valuation of the balance history. It reads under unrealized by that sale’s slippage, the same amount under each method; zero figures when nothing is held. Null when a subnet held has no sale value: its pool unread or dissolved, or a sale the chain refuses (more than 1 000 times the pool’s alpha reserve, or out of a pool holding under 0.001 TAO); on the global row whenever one subnet’s is; on rows stored before it existed.
object
In rao, signed: the figure in TAO, under each cost-basis method.
object
In rao, signed. Weighted average cost: what leaves a position takes its average cost.
In rao, signed. First in, first out: what leaves a position takes the cost of its oldest lots.
In USD, each trade at the TAO/USD of its hour, so the TAO/USD move during the hold counts.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
In USD: tao at the TAO/USD of the day it was computed, blind to the TAO/USD path during the hold.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
Carries no transfer_* keys, nor an unrealized_at_sale.
object
Date of the daily row the delta is taken from: the newest one before the snapshot’s date.
The change of realized since the since row. Its usd_then also reprices all earlier PnL at the TAO/USD move; usd_throughout does not.
object
In rao, signed: the figure in TAO, under each cost-basis method.
object
In rao, signed. Weighted average cost: what leaves a position takes its average cost.
In rao, signed. First in, first out: what leaves a position takes the cost of its oldest lots.
In USD, each trade at the TAO/USD of its hour, so the TAO/USD move during the hold counts.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
In USD: tao at the TAO/USD of the day it was computed, blind to the TAO/USD path during the hold.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
The change of unrealized since the since row.
object
In rao, signed: the figure in TAO, under each cost-basis method.
object
In rao, signed. Weighted average cost: what leaves a position takes its average cost.
In rao, signed. First in, first out: what leaves a position takes the cost of its oldest lots.
In USD, each trade at the TAO/USD of its hour, so the TAO/USD move during the hold counts.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
In USD: tao at the TAO/USD of the day it was computed, blind to the TAO/USD path during the hold.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
Subnet stake sent to other coldkeys over all time, its sale already in realized. Root stake counts in transfer_tao_out.
object
In rao, despite the name. What that alpha was worth in TAO when it moved, as the chain reported it.
In alpha rao. The alpha moved.
In USD, as a decimal string. tao at the TAO/USD of each move.
Subnet stake received from other coldkeys over all time, entered in the cost basis at its value on arrival. Root stake counts in transfer_tao_in.
object
In rao, despite the name. What that alpha was worth in TAO when it moved, as the chain reported it.
In alpha rao. The alpha moved.
In USD, as a decimal string. tao at the TAO/USD of each move.
Always zero on a per-subnet row.
object
In rao, despite the name. The TAO moved by plain transfer, or as root stake moved between coldkeys.
In USD, as a decimal string. tao at the TAO/USD of each move.
Always zero on a per-subnet row.
object
In rao, despite the name. The TAO moved by plain transfer, or as root stake moved between coldkeys.
In USD, as a decimal string. tao at the TAO/USD of each move.
Always null on the GLOBAL row: α of two subnets are not one asset.
object
Α still held, in α-rao, as the unrealized figure marked it.
Of alpha, the share bought, not earned as emission or received through a transfer of stake.
What ALL that α cost, τ in rao (WAC): the basis unrealized.tao.wac was marked against.
Decimal STRING. What that α cost in USD, at the rates paid.
Of tao, what the bought alpha cost, the numerator of avg_tao_bought. Null on a row stored before this split existed.
Decimal STRING. The USD twin of bought_tao, at the rates paid.
Every α ever BOUGHT here, α-rao. No sale takes it back, so a closed position still carries it.
Every τ ever spent buying it, in rao.
Decimal STRING. The same, at the rates paid.
What an α COST: tao over every α held. Null when nothing is held.
Decimal STRING. USD per WHOLE α at the rates PAID, so it cannot be derived from avg_tao and today’s τ/USD.
What was PAID per α still held: bought_tao over alpha_bought. May read BELOW avg_tao, whose tao carries α received by transfer at the pool’s value, which nobody paid for here. Null on a position made only of emissions and receipts.
Decimal STRING. The USD twin of avg_tao_bought, at the rates paid.
What was paid per α over the position’s WHOLE LIFE. The only average a fully exited position still has.
Decimal STRING. The USD twin of avg_tao_lifetime, at the rates paid.
unrealized_tao only on this route.
object
In rao, despite the name. The alpha held now times its price change over 24 hours, signed, with no cost basis; root counts zero.
as_of minus 24 hours, to the minute. Each subnet’s baseline price is its last at or before it.
When the move was computed. A reply is cached for up to two minutes.
This netuid’s dissolved occupants the coldkey traded.
A recycled netuid’s dissolved occupant the coldkey traded: its realized PnL, closed when the netuid registered
its next occupant. No position, no APY: nothing of it is held. The netuid’s subnets[] line is its current occupant’s.
object
The netuid it held before a new subnet registered on it.
Its registration block; dTAO’s first block for an occupant registered before dTAO.
Block time of registered_block. Null when that block’s time is unknown.
The block that removed it.
Block time of dissolved_block. Null when that block’s time is unknown.
Realized only: nothing of the occupant is held, so nothing is unrealized.
object
Booked over its whole life, the refund paid at its dissolution included.
object
In rao, signed: the figure in TAO, under each cost-basis method.
object
In rao, signed. Weighted average cost: what leaves a position takes its average cost.
In rao, signed. First in, first out: what leaves a position takes the cost of its oldest lots.
In USD, each trade at the TAO/USD of its hour, so the TAO/USD move during the hold counts.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
In USD: tao at the TAO/USD of the day it was computed, blind to the TAO/USD path during the hold.
object
In USD, as a signed decimal string. Weighted average cost.
In USD, as a signed decimal string. First in, first out.
Example generated
{ "account": "example", "netuid": 1, "as_of": "2026-04-15T12:00:00Z", "pnl_source": "example", "apy": { "alpha": { "7d": 1, "30d": 1, "all": 1 }, "tao": { "7d": 1, "30d": 1, "all": 1 }, "usd": { "7d": 1, "30d": 1, "all": 1 }, "days_observed": { "7d": 1, "30d": 1, "all": 1 }, "value_change_alpha": { "7d": 1, "30d": 1, "all": 1 }, "value_change_tao": { "7d": 1, "30d": 1, "all": 1 }, "value_change_usd": { "7d": "example", "30d": "example", "all": "example" }, "flow_tao": { "7d": 1, "30d": 1, "all": 1 }, "basis_tao": { "7d": 1, "30d": 1, "all": 1 }, "return_tao": { "7d": 1, "30d": 1, "all": 1 }, "return_usd": { "7d": 1, "30d": 1, "all": 1 } }, "pnl": { "realized": { "tao": { "wac": 1, "fifo": 1 }, "usd_throughout": { "wac": "example", "fifo": "example" }, "usd_then": { "wac": "example", "fifo": "example" } }, "unrealized": { "tao": { "wac": 1, "fifo": 1 }, "usd_throughout": { "wac": "example", "fifo": "example" }, "usd_then": { "wac": "example", "fifo": "example" } }, "unrealized_at_sale": { "tao": { "wac": 1, "fifo": 1 }, "usd_throughout": { "wac": "example", "fifo": "example" }, "usd_then": { "wac": "example", "fifo": "example" } }, "change_24h": { "since": "2026-04-15", "realized": { "tao": { "wac": 1, "fifo": 1 }, "usd_throughout": { "wac": "example", "fifo": "example" }, "usd_then": { "wac": "example", "fifo": "example" } }, "unrealized": { "tao": { "wac": 1, "fifo": 1 }, "usd_throughout": { "wac": "example", "fifo": "example" }, "usd_then": { "wac": "example", "fifo": "example" } } }, "transfer_stake_out": { "tao": 1, "alpha": 1, "usd": "example" }, "transfer_stake_in": { "tao": 1, "alpha": 1, "usd": "example" }, "transfer_tao_out": { "tao": 1, "usd": "example" }, "transfer_tao_in": { "tao": 1, "usd": "example" }, "cost_basis": { "alpha": 1, "alpha_bought": 1, "tao": 1, "usd": "example", "bought_tao": 1, "bought_usd": "example", "lifetime_alpha_bought": 1, "lifetime_tao": 1, "lifetime_usd": "example", "avg_tao": 1, "avg_usd": "example", "avg_tao_bought": 1, "avg_usd_bought": "example", "avg_tao_lifetime": 1, "avg_usd_lifetime": "example" } }, "rolling_24h": { "unrealized_tao": 1, "since": "2026-04-15T12:00:00Z", "as_of": "2026-04-15T12:00:00Z" }, "previous_occupants": [ { "netuid": 1, "registered_block": 1, "registered_at": "2026-04-15T12:00:00Z", "dissolved_block": 1, "dissolved_at": "2026-04-15T12:00:00Z", "pnl": { "realized": { "tao": { "wac": 1, "fifo": 1 }, "usd_throughout": { "wac": "example", "fifo": "example" }, "usd_then": { "wac": "example", "fifo": "example" } } } } ]}A parameter failed its check, which message names. code is usually VALIDATION_ERROR.
The error envelope every 4xx and 5xx response carries. The introduction lists the code values.
object
Always true. Lets a client branch without reading the status code.
Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.
One human-readable sentence.
Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.
Examples
VALIDATION_ERROR
{ "error": true, "code": "VALIDATION_ERROR", "message": "netuid is required", "detail": null}RESOURCE_NOT_FOUND. Carries Cache-Control: public, max-age=15, short because a new block or extrinsic is indexed up to a minute late.
The error envelope every 4xx and 5xx response carries. The introduction lists the code values.
object
Always true. Lets a client branch without reading the status code.
Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.
One human-readable sentence.
Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.
Examples
RESOURCE_NOT_FOUND
{ "error": true, "code": "RESOURCE_NOT_FOUND", "message": "Not found", "detail": null}Rate limit exceeded (300/minute, per IP). Retry-After carries the seconds to wait.
The error envelope every 4xx and 5xx response carries. The introduction lists the code values.
object
Always true. Lets a client branch without reading the status code.
Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.
One human-readable sentence.
Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.
Examples
RATE_LIMITED
{ "error": true, "code": "RATE_LIMITED", "message": "Request was throttled", "detail": { "retry_after": 12 }}Headers
Section titled “Headers”Seconds before the next request is accepted.
QUERY_TIMEOUT: the query exceeded its budget. detail carries budget_ms, elapsed_ms, path and query.
The error envelope every 4xx and 5xx response carries. The introduction lists the code values.
object
Always true. Lets a client branch without reading the status code.
Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.
One human-readable sentence.
Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.
Examples
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" }}