Transactions

unstake-all

Unstake everything from a hotkey across all subnets.

View as Markdown

Sweeps the signing coldkey's entire stake held on this hotkey across every subnet (root included) back to TAO in the coldkey's free balance. Subnets where subtoken trading is disabled or where the position fails validation (e.g. dust below the chain minimum) are silently skipped, so the call can succeed while leaving some positions untouched. Alpha positions are sold at each pool's current price with no limit protection, so large positions can incur significant slippage. Use remove_stake to exit a single subnet, or unstake_all_alpha to consolidate onto root while staying staked.

SignerPalletWraps
coldkeySubtensorModuleSubtensorModule.unstake_all

Parameters

ParameterTypeRequiredDescription
hotkey_ss58stringyesHotkey whose entire stake is removed.

Address parameters (--hotkey, --coldkey, --dest, ...) accept a raw ss58 address, an address-book or proxy-book name, or a local wallet/hotkey name.

CLI

Preview with --dry-run (shows fee, effects, and policy result without submitting), then submit:

btcli tx unstake-all \
  --hotkey <ss58|name> --dry-run
btcli tx unstake-all \
  --hotkey <ss58|name> -w my_coldkey

Python

import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.UnstakeAll(hotkey_ss58="5F...")

async with sub.Client("finney") as client:
    plan = await client.plan(intent, wallet)   # fee, effects, policy — no submission
    result = await client.execute(intent, wallet)
    if not result.success:
        print(result.error.code, result.error.remediation)

Or build it by op name, as an agent would:

await client.execute_tool("unstake_all", {...}, wallet)