# transfer-gamma (/docs/tx/transfer-gamma)

Sends exactly `amount_gamma` from your gamma balance, or your deposit at
`origin_hotkey_ss58`, to the gamma balance of `dest_coldkey_ss58`, or
its deposit at `destination_hotkey_ss58`, opening one with no daily spend
cap if there is none: only at a hotkey no other coldkey owns, and while the
receiver holds fewer than 32 deposits across subnets and has no coldkey swap
underway. The amount is at least 0.1 gamma, leaving none or at least as
much. A transfer that empties your deposit closes it.

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

## Parameters [#parameters]

| Parameter                 | Type    | Required | Description                                                                                                                                                                                     |
| ------------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `netuid`                  | integer | yes      | Subnet of the gamma.                                                                                                                                                                            |
| `dest_coldkey_ss58`       | string  | yes      | Coldkey receiving the gamma.                                                                                                                                                                    |
| `amount_gamma`            | number  | yes      | Gamma sent.                                                                                                                                                                                     |
| `origin_hotkey_ss58`      | string  | no       | Hotkey of your deposit to send from. Omit to send from your balance.                                                                                                                            |
| `destination_hotkey_ss58` | string  | no       | Hotkey of the receiver's deposit to credit, which that hotkey spends under the deposit's daily spend cap, or opens with none. Omit to credit its balance, which its coldkey must deposit first. |

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 transfer-gamma \
  --netuid <int> \
  --dest-coldkey <ss58|name> \
  --amount-gamma <amount> --dry-run
btcli tx transfer-gamma \
  --netuid <int> \
  --dest-coldkey <ss58|name> \
  --amount-gamma <amount> -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.TransferGamma(netuid=1, dest_coldkey_ss58="5G...destination", amount_gamma=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("transfer_gamma", {...}, wallet)
```

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

`SubtensorModule.transfer_gamma` — [`pallets/subtensor/src/macros/dispatches.rs#L3330`](/code/pallets/subtensor/src/macros/dispatches.rs#L3328-L3346):

```rust
#[pallet::call_index(177)]
#[pallet::weight((Pallet::<T>::transfer_gamma_weight(destination_hotkey.is_some()), DispatchClass::Normal, Pays::Yes))]
pub fn transfer_gamma(
    origin: OriginFor<T>,
    destination_coldkey: T::AccountId,
    origin_hotkey: Option<T::AccountId>,
    destination_hotkey: Option<T::AccountId>,
    netuid: NetUid,
    amount: GammaBalance,
) -> DispatchResult {
    Self::do_transfer_gamma(
        origin,
        destination_coldkey,
        origin_hotkey,
        destination_hotkey,
        netuid,
        amount,
    )
}
```

Delegates to [`do_transfer_gamma`](/code/pallets/subtensor/src/subnets/gamma.rs#L761).

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