# move-stake (/docs/tx/move-stake)

Re-delegates an existing position without passing through the coldkey's
free balance: the stake leaves the origin hotkey on the origin subnet and
lands on the destination hotkey at the destination subnet. Moving within
one subnet just changes which validator backs the stake; moving across
subnets swaps through both pools and can incur slippage on each leg.
Ownership stays with the signing coldkey — use `transfer_stake` to hand
the position to another coldkey, or `swap_stake` when only the subnet
changes.

| Signer    | Origin                                 | Pallet          | Wraps                                                                                        |
| --------- | -------------------------------------- | --------------- | -------------------------------------------------------------------------------------------- |
| `coldkey` | signed account (pallet role may apply) | SubtensorModule | [`SubtensorModule.move_stake`](/code/pallets/subtensor/src/macros/dispatches.rs#L1255-L1273) |

## Parameters [#parameters]

| Parameter            | Type              | Required | Description                                                                                                                                            |
| -------------------- | ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `origin_hotkey_ss58` | string            | yes      | Hotkey the stake moves away from.                                                                                                                      |
| `origin_netuid`      | integer           | yes      | Subnet the stake currently sits on.                                                                                                                    |
| `dest_hotkey_ss58`   | string            | yes      | Hotkey the stake moves to.                                                                                                                             |
| `dest_netuid`        | integer           | yes      | Subnet the stake ends up on. When it differs from the origin, the position is swapped through both subnet pools, which can incur slippage on each leg. |
| `amount_alpha`       | number \| `"all"` | yes      | How much of the origin position to move (an explicit amount; `all` is not accepted).                                                                   |

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

## CLI [#cli]

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

```bash
btcli tx move-stake \
  --origin-hotkey <ss58|name> \
  --origin-netuid <int> \
  --dest-hotkey <ss58|name> \
  --dest-netuid <int> \
  --amount-alpha <amount|all> --dry-run
btcli tx move-stake \
  --origin-hotkey <ss58|name> \
  --origin-netuid <int> \
  --dest-hotkey <ss58|name> \
  --dest-netuid <int> \
  --amount-alpha <amount|all> -w my_coldkey
```

## Python [#python]

```python
import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.MoveStake(origin_hotkey_ss58="5F...", origin_netuid=0, dest_hotkey_ss58="5F...", dest_netuid=0, amount_alpha=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](/docs/concepts/client).) Or build the intent by op name, as
an agent would:

```python
result = sub.execute_tool("move_stake", {...}, wallet)
```

## On-chain implementation [#on-chain-implementation]

`SubtensorModule.move_stake` — [`pallets/subtensor/src/macros/dispatches.rs#L1257`](/code/pallets/subtensor/src/macros/dispatches.rs#L1255-L1273):

```rust
#[pallet::call_index(85)]
#[pallet::weight(<T as crate::pallet::Config>::WeightInfo::move_stake())]
pub fn move_stake(
    origin: OriginFor<T>,
    origin_hotkey: T::AccountId,
    destination_hotkey: T::AccountId,
    origin_netuid: NetUid,
    destination_netuid: NetUid,
    alpha_amount: AlphaBalance,
) -> DispatchResult {
    Self::do_move_stake(
        origin,
        origin_hotkey,
        destination_hotkey,
        origin_netuid,
        destination_netuid,
        alpha_amount,
    )
}
```

Delegates to [`do_move_stake`](/code/pallets/subtensor/src/staking/move_stake.rs#L30).

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