Alpha

Storage Map Poll per tempo v233 → v472 · 1 shape change

Legacy alpha stake per (hotkey , coldkey , netuid ), stored as FixedU128 { bits }. Superseded by AlphaV2 at v401.

Explore chain
Queried by: stakersvalidatorsdelegatorsanalyticswallets

The Big Picture

Each subnet has its own 'alpha' token representing stake on that specific subnet. When you stake TAO to a subnet, you receive alpha proportional to the current exchange rate. Alpha stake determines your share of that subnet's emissions. It's like having a stake position denominated in subnet-specific units.

Why This Matters

Your stake on subnet X isn't just TAO - it's converted to alpha at the current rate. Alpha tracks your proportional ownership of stake on that subnet. Check Alpha to see your actual position.

Example Scenario

Query Alpha(hotkey=validator_X, coldkey=you, netuid=1) returns 1500000000000. You hold 1.5T alpha (1.5 trillion units) on subnet 1. Your share of emissions depends on this vs TotalAlpha(netuid=1).

Note: source-verified key order is (hotkey, coldkey, netuid), NOT (coldkey, hotkey, netuid).

Common Questions

How does alpha relate to TAO?
When you stake TAO, it's converted to alpha at the current pool rate (SubnetTAO/SubnetAlphaIn). When you unstake, alpha converts back to TAO at the current rate - which may differ.
Why alpha instead of just tracking TAO?
Alpha enables dynamic pricing. As more TAO enters a subnet, alpha becomes relatively more valuable. This creates economic incentives around subnet performance and demand.
Can I lose alpha?
Alpha is your stake. It doesn't decrease unless you unstake. But its TAO value fluctuates based on the subnet's liquidity pool dynamics.
Is alpha transferable?
Alpha is stake, not a transferable token. You can unstake (converting to TAO) and restake elsewhere, but can't directly send alpha to another account.

Use Cases

  • Check your alpha stake on a specific subnet
  • Calculate portfolio value in subnet-specific terms
  • Track alpha accumulation from staking
  • Build subnet-specific staking dashboards
  • Analyze alpha distribution across coldkeys

From Chain Metadata

NMAP ( hot, cold, netuid ) --> alpha | Returns the alpha shares for a hotkey, coldkey, netuid triplet.

Purpose & Usage

Purpose

Track subnet-specific stake in alpha tokens - the subnet's native staking currency. Both this storage and AlphaV2 are populated with disjoint key sets at v411; consumers must check both.

Common Query Patterns

  • Query alpha by (hotkey, coldkey, netuid)
  • Calculate subnet-specific stake position
  • Compare alpha holdings across validators
  • Read AlphaV2 as well: the key sets are disjoint, so a live position is in exactly one of them or in neither

Notes

  • The legacy map is remove-only in the current runtime: no code path inserts into it, so its population can only shrink and a row here is always an untouched pre-v401 position, never a tombstone. There was no one-shot migration; the move to V2 happens lazily on the next write.
  • A zero value is REMOVED, not stored. set_share writes AlphaV2 only when the share is nonzero and set_denominator writes TotalHotkeySharesV2 only when the denominator is nonzero, each removing the legacy row first, so a drained position or a closed pool is absent from BOTH generations. Absent from both is a normal state, not a gap (staking/stake_utils.rs set_share and set_denominator at v468).
  • All four share maps are ValueQuery, so a point read of a key that does not exist returns the zero fallback rather than an absence. Absence and a stored zero are indistinguishable to a point read; use an existence check or key enumeration to tell them apart.
Part of: Yuma ConsensusStake Operations

Migration Notes

v424 v432 Breaking

key type changed from (AccountId, AccountId, u16) to (AccountId, AccountId, NetUid)

Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.

Query Keys

#NameTypeDescription
1
hotkey hotkey
raw: hot
AccountId hot (AccountId, hashed key component) (hex -> SS58)
2
coldkey coldkey
raw: cold
AccountId cold (AccountId, hashed key component) (hex -> SS58)
3
netuid netuid
NetUid netuid (NetUid, hashed key component)

Stored Value

alpha (FixedU128)

Default Value

0 0x00000000000000000000000000000000

Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.

Decoding the value

FixedU128

Q64.64 fixed-point. Magnitude check: bits > 0.

value as bigint

Relationships

Related Storages

  • AlphaV2 Superseded by Coexists with check both decodes differently V2 introduced at runtime v401 with SafeFloat (mantissa+exponent) value type. V2 holds active staking positions (100% non-zero in 50K sample); legacy holds the historical population (~12% non-zero in 50K sample). Key sets verified DISJOINT across the 50K cap. Legacy uses FixedU128 with { bits: u128 }; V2 uses SafeFloat with { mantissa: bigint, exponent: i64 }. An indexer that reads .bits uniformly silently gets zero from V2 entries.

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query Alpha storage
const hot = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const cold = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const netuid = 1;

const result = await api.query.SubtensorModule.Alpha.getValue(hot, cold, netuid);
console.log("Alpha:", result);

On-Chain Activity

Write Frequency
●●●●●● Ultra-High >10M est. writes

>10M estimated writes

#3 most written storage item

Write Source User Extrinsics

Modified via user-submitted extrinsics

As of block 7,429,232

Version History

v233 block 4,920,350 Added
v425–v431 · runtime versions skipped on chain (never deployed)
v432 block 8,636,190 Shape changed Current
  • key : (AccountId, AccountId, u16) → (AccountId, AccountId, NetUid)

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v233
Current Version
v472