Transactions

stake-burn

Buy back / burn stake via the stake-burn extrinsic.

View as Markdown

Spends TAO from the signing coldkey to buy the subnet's alpha and burn it, reducing alpha supply (a buyback-and-burn) rather than adding to the signer's stake. The TAO is spent permanently — nothing lands in your stake, so this is not an investment call; use a regular add-stake intent to acquire a position. Fails on the root subnet (CannotBurnOrRecycleOnRootSubnet). The chain accepts an optional limit (omitted = market order), but this intent always submits one and executes all-or-nothing: the swap fails instead of partially filling at a worse rate. When limit_price is omitted, the limit is derived from the current pool price plus rate_tolerance (5% by default). Counts against a configured spend cap.

SignerOriginPalletWraps
coldkeysigned account (pallet role may apply)SubtensorModuleSubtensorModule.add_stake_burn

Parameters

ParameterTypeRequiredDescription
netuidintegeryesSubnet whose alpha is bought and burned.
amount_taonumber | "all"yesSpent from the coldkey to buy alpha that is then burned.
limit_priceintegernoWorst acceptable price in rao per alpha; the call fails rather than filling beyond it. Defaults to the current pool price plus rate_tolerance.
rate_tolerancenumbernoMaximum price move accepted when limit_price is omitted, as a fraction (0.05 = 5%). Ignored when limit_price is given.
hotkey_ss58stringnoHotkey the burn is routed through; defaults to the wallet's hotkey.

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 stake-burn \
  --netuid <int> \
  --amount-tao <amount|all> --dry-run
btcli tx stake-burn \
  --netuid <int> \
  --amount-tao <amount|all> -w my_coldkey

Python

import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.StakeBurn(netuid=1, amount_tao=1.0)

sub = bt.Subtensor()
plan = sub.plan(intent, wallet)   # fee, effects, policy — no submission
result = sub.execute(intent, wallet)
if not result.success:
    print(result.error.code, result.error.remediation)

(bt.Subtensor is also the async client — async with bt.Subtensor() as client: — see The client.) Or build the intent by op name, as an agent would:

result = sub.execute_tool("stake_burn", {...}, wallet)

On-chain implementation

SubtensorModule.add_stake_burnpallets/subtensor/src/macros/dispatches.rs#L2289:

#[pallet::call_index(132)]
#[pallet::weight(<T as crate::pallet::Config>::WeightInfo::add_stake_burn())]
pub fn add_stake_burn(
    origin: OriginFor<T>,
    hotkey: T::AccountId,
    netuid: NetUid,
    amount: TaoBalance,
    limit: Option<TaoBalance>,
) -> DispatchResult {
    Self::do_add_stake_burn(origin, hotkey, netuid, amount, limit)
}

Delegates to do_add_stake_burn.

Every file is browsable under /code exactly as built into the runtime, or as plain text under /code/raw/<path> (index: /code/index.json).