LastHotkeySwapOnNetuid

Storage Map v276 → current

Block of last hotkey swap on a subnet .

Explore chain
Queried by: validatorsdevelopers

The Big Picture

Hotkey swaps on subnets are rate-limited. This tracks when the last swap occurred, enabling cooldown calculations and preventing spam swaps.

Use Cases

  • Check swap cooldowns
  • Plan hotkey operations
  • Debug rate limit errors

From Chain Metadata

DMap ( netuid, coldkey ) --> blocknumber | last hotkey swap on network.

Purpose & Usage

Purpose

Track hotkey swap timing for rate limiting.

Common Query Patterns

  • Query by (hotkey, netuid)

Query Keys

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

Stored Value

Value in RAO (÷10⁹ for TAO)

RAO -> TAO (/ 10^9)

Relationships

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 LastHotkeySwapOnNetuid storage
const key1 = 0;
const key2 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

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

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

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v276
Current Version
v393