StakeRemoved
Event v101 → v219, v233 → v252, v257 → v277, v290 → v292, v297 → v298, v301 → v385, v391 → v424, v432 → current #3Emitted after stake is successfully withdrawn from hotkey to coldkey .
View events on chainThe Big Picture
Unstaking converts your subnet-specific Alpha tokens back to liquid TAO. The amount you receive depends on the current Alpha/TAO exchange rate, which can be higher or lower than when you staked. This is why many prefer move_stake when rebalancing - it avoids this conversion.
Why This Matters
When you unstake, your Alpha tokens are converted back to TAO at the current rate. This event confirms the conversion completed and shows exactly how much TAO you received. Important: the TAO amount may differ from what you originally staked due to price changes.
Example Scenario
You staked 100 TAO six months ago when Alpha was 1:1. Now Alpha is worth 1.2 TAO. You unstake and StakeRemoved fires showing you received 120 TAO - a 20% gain from Alpha appreciation plus any emissions you earned.
Common Questions
- Why did I get less TAO than I staked?
- Alpha price fluctuates. If the subnet's Alpha dropped in value, you'll receive less TAO. Consider using move_stake instead to avoid conversion if you're rebalancing.
- Is there a delay before I can use my unstaked TAO?
- No, the TAO is immediately available in your coldkey balance.
Use Cases
- Confirm your unstake transaction completed
- Track when delegators leave your validator
- Monitor unstaking trends across the network
- Build withdrawal notification systems
How to Use This Event
- → Subscribe to your coldkey for withdrawal confirmations
- → Monitor validator hotkeys to track delegator churn
- → Index network-wide to analyze unstaking patterns
From Chain Metadata
stake has been removed from the hotkey staking account onto the coldkey account.
Migration Notes
arg1 changed from u64 to AccountId; added field arg2 (u64); added field arg3 (u64); added field arg4 (u16)
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.
added field arg5 (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.
arg2 changed from u64 to TaoBalance; arg3 changed from u64 to AlphaBalance; arg4 changed from u16 to 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.
Triggers
Preconditions
- Hotkey has sufficient staked amount
- Coldkey is associated with the hotkey
- Remaining stake meets minimum requirements (if any)
Effects
Storage Modified
Postconditions
- Coldkey balance increased by unstaked amount
- Hotkey's total stake decreased
- Network's TotalStake decreased
Side Effects
- Alpha converted back to TAO at current rate
- May affect validator ranking
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | arg0 → coldkey | AccountId | Coldkey receiving the unstaked TAO (or origin coldkey on transfer) (hex -> SS58) |
| 1 | arg1 → hotkey | AccountId | Hotkey from which alpha was removed (hex -> SS58) |
| 2 | arg2 → tao_amount | TaoBalance | TAO leg in RAO. Real unstake: TAO delivered post-swap (SwapResult.amount_paid_out). In-subnet transfer: synthetic TAO equivalent at current AMM price. Asymmetric with StakeAdded.arg2, which is pre-fee input. |
| 3 | arg3 → alpha_unstaked | AlphaBalance | Alpha that entered the swap pool from THIS operation, in alpha-RAO (SwapResult.amount_paid_in), net of the swap fee reported in arg5. In the raw event the alpha removed from the (hotkey, coldkey, netuid) share pool is arg3 + arg5: the pool is debited the full requested alpha and the unswapped remainder is credited back, so arg3 + arg5 can be less than requested when a price limit is hit. In-subnet transfer emits the full alpha at arg3 with arg5 hardcoded 0, where arg3 + arg5 still holds. Net only from v401; v290 through v400 emitted the gross debit here. Per-operation delta, NOT a remaining/cumulative total. |
| 4 | arg4 → netuid | NetUid | Subnet ID |
| 5 | arg5 → fee_paid_alpha | u64 | Swap fee in ALPHA RAO (PaidIn=Alpha for swap_alpha_for_tao), truncated from AlphaCurrency. Note: different denomination than StakeAdded.arg5 (which is TAO RAO). Always 0 for in-subnet transfers. |
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 StakeRemoved events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.SubtensorModule.StakeRemoved.get(block.hash);
for (const evt of events) {
console.log("StakeRemoved:", evt.payload);
}
});On-Chain Activity
Core protocol operations, high volume
#8 most emitted event
As of block 9,385,000
Version History
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 3
- First Version
- v101
- Current Version
- v490