AllBalanceUnstakedAndTransferredToNewColdkey

Event Re-added v156 → v157, v158 → v161, v162 → v165, v195 → v219, v233 → v247, v252 → v265, v273 → v277, v290 → v315, v320 → v326, v334 → v367, v372 → v377, v385 → current #71

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

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 (AccountId) (hex -> SS58)
1
new_coldkey
AccountId new_coldkey (AccountId) (hex -> SS58)
2
total_balance
u64 total_balance (u64) (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 });

// Subscribe to AllBalanceUnstakedAndTransferredToNewColdkey events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("SubtensorModule") &&
      event.method === "AllBalanceUnstakedAndTransferredToNewColdkey"
    )
    .forEach(({ event }) => {
      console.log("AllBalanceUnstakedAndTransferredToNewColdkey:", event.data.toHuman());
    });
});

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 Current

Runtime Info

View Source
Pallet Index
7
Event Index
71
First Version
v156
Current Version
v393