AllBalanceUnstakedAndTransferredToNewColdkey

Event v156 → v157, v158 → v161, v162 → v165, v195 → v219, v233 → v247, v252 → v265, v273 → v277, v290 → v315, v320 → v326, v334 → v367, v372 → v377, v385 → v402, v411 → current Changed in v411 #72

Emitted when all stake is unstaked and transferred during coldkey swap .

View events on chain
Useful for: stakersvalidatorswalletsexchangesanalytics

The Big Picture

During a coldkey swap, you might want everything moved - not just stake ownership, but complete liquidation to the new coldkey. This event fires when all staked positions are unstaked (converted to TAO) and transferred to the new coldkey. It's a complete migration: no assets left with the old coldkey, everything liquid and available at the new address.

Why This Matters

This is the nuclear option for coldkey migration - everything unstaked and moved. Unlike normal ColdkeySwapped which transfers stake ownership, this liquidates all positions. You receive TAO at your new coldkey, but you've exited all your staking positions (with any Alpha→TAO conversion implications).

Example Scenario

You want to completely migrate to a new wallet with no ties to the old one. During coldkey swap, AllBalanceUnstakedAndTransferredToNewColdkey fires showing 500 TAO total. All your stake positions were converted to TAO and sent to your new coldkey. You'll need to restake from scratch if you want to continue earning.

Common Questions

Does this lose my Alpha positions?
Yes - Alpha is converted to TAO during unstaking. You receive TAO at current exchange rates, which may be better or worse than when you originally staked.
Do my hotkeys lose their registrations?
This event is about stake/balance transfer. Hotkey registrations may be handled separately in the swap process. Check HotkeySwapped events for hotkey migration details.
Why would I choose this over normal swap?
If you want completely clean migration with liquid TAO, no legacy positions. Normal swap keeps your positions intact with new ownership. This liquidates everything.

Use Cases

  • Track complete asset migration during coldkey swap
  • Monitor when stake positions are liquidated for migration
  • Verify all assets transferred to new coldkey
  • Build migration audit tools

How to Use This Event

  • Monitor for complete migration events
  • Track when large stakers liquidate positions
  • Build migration verification dashboards

From Chain Metadata

All balance of a hotkey has been unstaked and transferred to a new coldkey

Migration Notes

v157 v158 Breaking

removed field hotkey (was AccountId); removed field current_stake (was u64)

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.

Triggers

Effects

Postconditions

  • All stake converted to free balance
  • Free balance transferred to new coldkey

Side Effects

  • Hotkeys may lose validator status if stake removed

Event Data

#NameTypeDescription
0
current_coldkey
AccountId current_coldkey: Account address (32 bytes, SS58-encoded) (hex -> SS58)
1
new_coldkey
AccountId new_coldkey: Account address (32 bytes, SS58-encoded) (hex -> SS58)
2
total_balance
u64 <<T as Config>::Currency as fungible::Inspect<<T as frame_system:: Config>::AccountId,>>::Balancetotal_balance (u64) (RAO -> TAO (/ 10^9))

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 AllBalanceUnstakedAndTransferredToNewColdkey events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.SubtensorModule.AllBalanceUnstakedAndTransferredToNewColdkey.get(block.hash);
  for (const evt of events) {
    console.log("AllBalanceUnstakedAndTransferredToNewColdkey:", evt.payload);
  }
});

Version History

v156 block 3,321,841 5 args
v158 block 3,322,072 3 args
v162 block 3,372,565 3 args
v195 block 3,791,350 3 args
v233 block 4,920,350 3 args
v252 block 5,163,656 3 args
v273 block 5,659,032 3 args
v290 block 5,947,548 3 args
v320 block 6,523,566 3 args
v334 block 6,811,690 3 args
v372 block 7,430,358 3 args
v385 block 7,782,670 3 args
v411 block 8,283,784 3 args Current

Runtime Info

View Source
Pallet Index
7
Event Index
72
First Version
v156
Current Version
v411