remove_stake

Call v101 → v219, v233 → v277, v290 → v292, v297 → v385, v391 → current #3

Withdraws staked TAO from a hotkey back to the coldkey .

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: stakersdelegatorswalletsexchanges

The Big Picture

Unstaking converts your Alpha back to TAO at the current exchange rate. Unlike move_stake, this involves an actual price conversion - you may get more or less TAO than you originally staked depending on how the subnet's Alpha has performed.

Why This Matters

When you need liquid TAO or want to exit a position, unstaking is how you do it. Be aware that the TAO amount depends on the current Alpha price - it's not 1:1.

Example Scenario

You staked 100 TAO when Alpha was 1:1. Now Alpha is 0.9:1 (subnet performed poorly). You call remove_stake for your full position. You receive 90 TAO back. The 10 TAO difference reflects Alpha depreciation.

Common Questions

Why did I get less/more than I staked?
Alpha price fluctuates based on subnet performance and market dynamics. You receive the current value of your Alpha, not the original TAO amount.
Can I avoid the conversion rate?
Use move_stake instead - it moves stake directly without converting to TAO, preserving your position size.

Use Cases

  • Convert stake back to liquid TAO
  • Exit a position in a validator or subnet
  • Rebalance your portfolio

From Chain Metadata

Remove stake from the staking account. The call must be made from the coldkey account attached to the neuron metadata. Only this key has permission to make staking and unstaking requests.

Part of: Stake Operations

Migration Notes

v219 v233 Breaking

added field netuid (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.

Input Parameters

#NameTypeDescription
0
hotkey
AccountId Validator's hot wallet to unstake from (hex -> SS58)
1
netuid
u16 NetUidSubnet ID from which the stake is removed
2
amount_unstaked
u64 AlphaBalanceAlpha amount to unstake from this subnet (alpha-RAO). NOT a TAO amount — the TAO received depends on the swap output (see SubtensorModule.StakeRemoved.tao_amount). (RAO -> TAO (/ 10^9))

Permissions

Origin
Signed
Required Role
Authorization Checks
  • Coldkey must be associated with the target hotkey

Requirements

  • Hotkey has sufficient staked amount
  • Coldkey is associated with the hotkey
  • Remaining stake meets minimum requirements (if any)

Effects

Postconditions

  • Coldkey balance increased by unstaked amount
  • Hotkey's total stake decreased
  • Network's TotalStake decreased

Side Effects

  • May remove hotkey from validator set if stake too low
  • May update alpha stake on subnet

Possible Errors

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

// Build remove_stake call (typed, named args)
const hotkey = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const netuid = 1;
const amount_unstaked = 1_000_000_000n;

const tx = api.tx.SubtensorModule.remove_stake({
  hotkey,
  netuid,
  amount_unstaked,
});

On-Chain Activity

Usage Frequency
●●●●●○ Core 1M–10M extrinsics

Primary protocol calls

#5 most used call

Success Rate Moderate

50–80% of submissions succeed

As of block 7,429,232

Version History

v101 block 1 2 args
v233 block 4,920,350 3 args
v290 block 5,947,548 3 args
v297 block 6,067,943 3 args
v391 block 7,782,857 3 args Current

Runtime Info

View Source
Pallet Index
7
Call Index
3
First Version
v101
Current Version
v411