This storage item was removed in v240

This storage item is no longer available in the current runtime. Existed from v101 to v240. Shown here for historical reference.

Stake

Storage Removed Map v101 → v240 (removed)

Amount of TAO staked from a coldkey to a hotkey on a subnet .

Queried by: stakersvalidatorsdelegatorsanalyticswallets

The Big Picture

Stake is the core data structure for Bittensor economics. Every staking relationship - who staked how much to whom on which subnet - is recorded here. This drives validator power, emission distribution, and the entire incentive mechanism.

Why This Matters

Want to know how much you've staked somewhere? How much stake your validator has? Who's staking to whom? This is the source of truth for all staking data.

Example Scenario

You staked 100 TAO to Validator X on subnet 1. Query Stake(netuid=1, hotkey=X, coldkey=you) returns 100000000000 (in RAO). This is your current stake position.

Common Questions

Why is the value so large?
Stake is stored in RAO (1 TAO = 10^9 RAO). Divide by 1,000,000,000 to get TAO.
Can I iterate all my stakes?
Yes, iterate Stake with your coldkey as prefix to find all hotkeys you're staking to.

Use Cases

  • Check how much you have staked to a validator
  • Build staking leaderboards and analytics
  • Calculate portfolio value across validators
  • Monitor delegation changes over time

Purpose & Usage

Purpose

Tracks delegation relationships and stake amounts for validation.

Common Query Patterns

  • Query stake for a specific coldkey-hotkey-netuid combination
  • Iterate all stakes for a coldkey
  • Check if a hotkey has stake from a coldkey

Query Keys

#NameTypeDescription
1
key1
AccountId key1 (AccountId) (hex -> SS58)
2
key2
AccountId key2 (AccountId) (hex -> SS58)

Stored Value

Amount staked (RAO, ÷10⁹ for TAO)

RAO -> TAO (/ 10^9)

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Query Stake storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const key2 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query
  [stringCamelCase("SubtensorModule")]
  [stringCamelCase("Stake")](
  key1,
  key2
);

console.log("Stake:", result.toHuman());

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v101
Removed In
v240