StakeSwapped

Event v233 → v247, v252 → v265, v273 → v277, v290 → v298, v301 → v315, v320 → v326, v334 → v367, v372 → v377, v385 → v385, v391 → v402, v411 → current Changed in v411 #91

Emitted when stake is swapped between subnets for the same coldkey -hotkey pair.

View events on chain
Useful for: stakersvalidatorsanalytics

The Big Picture

When you stake to a hotkey that operates on multiple subnets, your stake might be concentrated on one subnet. Swapping lets you move that stake between subnets while keeping it with the same validator. This is useful when one subnet has better emissions or you want to diversify risk across subnets without changing validators.

Why This Matters

Different subnets have different emission rates and risks. Swapping lets you optimize your stake distribution without changing validators - you're just choosing which of your validator's subnets you want exposure to.

Example Scenario

You have 100 TAO staked to Validator X on subnet 1, but subnet 3 (also run by Validator X) has higher emissions. You swap 50 TAO from subnet 1 to subnet 3. StakeSwapped fires showing the move. Now you're earning from both subnets through the same validator.

Common Questions

How is this different from StakeMoved?
StakeSwapped moves stake between subnets for the SAME hotkey. StakeMoved moves stake between DIFFERENT hotkeys (possibly different validators entirely).
Does swapping affect my validator relationship?
No, your stake stays with the same validator - you're just choosing which of their subnets your stake is active on.

Use Cases

  • Rebalance stake across subnets for the same validator
  • Optimize exposure to different subnet emission rates
  • Track how validators distribute stake across their subnets

How to Use This Event

  • Monitor your own stake distribution across subnets
  • Track how top validators allocate delegated stake
  • Build portfolio optimization tools

From Chain Metadata

Stake has been swapped from one subnet to another for the same coldkey-hotkey pair. Parameters: (coldkey, hotkey, origin_netuid, destination_netuid, amount)

Triggers

Effects

Postconditions

  • Stake moved from origin subnet to destination subnet
  • Same coldkey-hotkey relationship preserved

Side Effects

  • Rebalances alpha stake between subnets
  • May affect subnet-specific rankings

Event Data

#NameTypeDescription
0
arg0
→ coldkey
AccountId Coldkey performing the swap (held constant) (hex -> SS58)
1
arg1
→ hotkey
AccountId Hotkey (held constant — swap only changes netuid) (hex -> SS58)
2
arg2
→ origin_netuid
u16 NetUidSubnet swapped FROM
3
arg3
→ destination_netuid
u16 NetUidSubnet swapped TO
4
arg4
→ amount_tao
u64 TaoBalanceNet TAO realised crossing subnets, post-fee (RAO). Always cross-subnet — same-subnet swap is a no-op.

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);

// Subscribe to StakeSwapped events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.SubtensorModule.StakeSwapped.get(block.hash);
  for (const evt of events) {
    console.log("StakeSwapped:", evt.payload);
  }
});

On-Chain Activity

Emission Frequency
●●●●○○ Significant 1M–5M emissions

Major features with millions of emissions

#25 most emitted event

As of block 7,429,232

Version History

v233 block 4,920,350 5 args
v252 block 5,163,656 5 args
v273 block 5,659,032 5 args
v290 block 5,947,548 5 args
v301 block 6,205,194 5 args
v320 block 6,523,566 5 args
v334 block 6,811,690 5 args
v372 block 7,430,358 5 args
v385 block 7,782,670 5 args
v391 block 7,782,857 5 args
v411 block 8,283,784 5 args Current

Runtime Info

View Source
Pallet Index
7
Event Index
91
First Version
v233
Current Version
v411