AutoStakeDestinationColdkeys

Storage Map v326 → v472 · 1 shape change

Coldkeys using auto-stake on a subnet .

Explore chain
Queried by: analyticsdevelopersvalidators

The Big Picture

This is the reverse index for auto-stake - given a subnet, who has auto-stake enabled? Useful for analytics and understanding how many users are using automatic compounding. Higher adoption suggests sophisticated, long-term oriented stakers.

Why This Matters

Want to know how many people use auto-stake on a subnet? This storage lets you enumerate them. Useful for measuring feature adoption and understanding staking behavior.

Example Scenario

Query AutoStakeDestinationColdkeys(netuid=1) returns [coldkey_A, coldkey_B, ...]. These coldkeys have auto-stake configured on subnet 1. Iterate to count or analyze auto-stake users.

Common Questions

Does this include all auto-stake users?
Yes, any coldkey with an auto-stake destination set for this subnet appears in this list.
Can I see where each one stakes?
This gives you the list. Query AutoStakeDestination(coldkey, netuid) for each to see their destination hotkey.

Use Cases

  • Measure auto-stake adoption rates
  • Build analytics on compound staking behavior
  • Index all auto-stake configurations for a subnet
  • Research staker behavior patterns
  • Understand validator flows from auto-stake

From Chain Metadata

DMAP ( hot, netuid )--> Vec<cold> | Returns a list of coldkeys that are autostaking to a hotkey

Purpose & Usage

Purpose

Track which coldkeys have auto-stake enabled - useful for analytics and indexing.

Common Query Patterns

  • Iterate auto-stake users by netuid
  • Count auto-stake adoption on a subnet
  • Build auto-stake analytics

Migration Notes

v424 v432 Breaking

key type changed from (AccountId, u16) to (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
hot
AccountId hot (AccountId, hashed key component) (hex -> SS58)
2
netuid
NetUid netuid (NetUid, hashed key component)

Stored Value

Vec<cold> (Vec<AccountId>)

Default Value

0x00 (raw SCALE bytes)

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

Relationships

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 AutoStakeDestinationColdkeys storage
const hot = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const netuid = 1;

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

Version History

v326 block 6,608,228 Added
v425–v431 · runtime versions skipped on chain (never deployed)
v432 block 8,636,190 Shape changed Current
  • key : (AccountId, u16) → (AccountId, NetUid)

Runtime Info

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