Queries

total-alpha-staked

Total alpha currently staked on a subnet, across all hotkeys (TAO when netuid is 0).

View as Markdown

This is the chain-maintained O(1) aggregate: it equals the sum of TotalHotkeyAlpha for the subnet. Use this instead of walking every position. After the v448 upgrade, the historical total is backfilled over otherwise-idle blocks. Until the bounded migration finishes, keys ahead of its cursor are omitted; concurrent stake changes are reconciled by completion but are not necessarily visible in this aggregate immediately.

Category: Staking

Parameters

ParameterTypeDescription
netuidintegerSubnet to query.

CLI

btcli query total-alpha-staked --netuid <integer> --json

Python

Namespace method (autocomplete, signature help):

import bittensor as bt

sub = bt.Subtensor()
result = sub.staking.total_alpha_staked(netuid=1)

Or dispatch by name, as an agent would:

result = sub.read("total_alpha_staked", netuid=1)

Async is the same surface awaited: async with bt.Subtensor() as client:.

On-chain implementation

Every file is browsable under /code exactly as built into the runtime.