TotalHotkeyAlphaLastEpoch
Storage Map v261 → v490 · 1 shape changeTotalHotkeyAlpha snapshot taken when AlphaDividendsPerSubnet was written, per hotkey per subnet .
Explore chainThe Big Picture
AlphaDividendsPerSubnet says how much alpha the nominators on a hotkey shared; this map says how much alpha they held when it was shared. The ratio is the epoch yield per unit of alpha.
Use Cases
- Compute per-alpha dividend yield for the last epoch
- Attribute AlphaDividendsPerSubnet to individual nominators
- Compare epoch-over-epoch hotkey alpha
From Chain Metadata
DMAP ( hot, netuid ) --> alpha | Returns the total amount of alpha a hotkey owned in the last epoch.
Purpose & Usage
Purpose
Provide the denominator for nominator dividend shares. It is the hotkey alpha the last epoch dividend was split against, recorded in the same loop that writes AlphaDividendsPerSubnet.
Common Query Patterns
- Query by (hotkey, netuid)
- nominator_share = AlphaDividendsPerSubnet / TotalHotkeyAlphaLastEpoch × own alpha
Notes
- Written in distribute_dividends_and_incentives (run_coinbase.rs L834-L840 at da06f033, v452) right after the nominator dividend for the hotkey is staked, so it already includes that epoch's credit. At v452 the entry is removed when TotalHotkeyAlpha is zero; at v411 a zero was inserted instead.
Migration Notes
key type changed from (AccountId, u16) to (AccountId, NetUid); value type changed from u64 to AlphaBalance
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
Stored Value
alpha (AlphaBalance)
Default Value
Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.
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 TotalHotkeyAlphaLastEpoch storage
const hot = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const netuid = 1;
const result = await api.query.SubtensorModule.TotalHotkeyAlphaLastEpoch.getValue(hot, netuid);
console.log("TotalHotkeyAlphaLastEpoch:", result);On-Chain Activity
More than 10M writes
#28 most written storage item
Modified by both user extrinsics and runtime hooks
As of block 9,385,000
Version History
- key :
(AccountId, u16)→(AccountId, NetUid) - value :
u64→AlphaBalance
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v261
- Current Version
- v490