Transactions

add-stake

Stake TAO from the coldkey onto a hotkey.

View as Markdown

Swaps TAO from the coldkey's free balance into the subnet's alpha at the current pool price and credits the result to your stake on the hotkey; on netuid 0 (root) the stake stays TAO-denominated. The swap moves the pool, so large amounts incur slippage — use add_stake_limit to bound the price. The position's value then follows the pool price and the validator's performance, and can be exited later with remove_stake. Fails if the coldkey's free balance cannot cover the amount plus the transaction fee, and with AmountTooLow when the amount is below the chain minimum of 0.002 TAO plus the swap fee. Dynamic subnets also reject a single swap larger than 1000x the pool's TAO reserve (InsufficientLiquidity).

SignerPalletWraps
coldkeySubtensorModuleSubtensorModule.add_stake

Parameters

ParameterTypeRequiredDescription
hotkey_ss58stringyesHotkey the stake is added to (the validator you are backing).
netuidintegeryesSubnet the stake lives on (netuid 0 is the root network).
amount_taonumber | "all"yesHow much of the coldkey's free balance to stake.

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

Python

import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.AddStake(hotkey_ss58="5F...", netuid=1, amount_tao=1.0)

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("add_stake", {...}, wallet)