# set-min-collateral (/docs/tx/set-min-collateral)

The collateral drain never releases the lock below the floor, and while
the lock is under it, earned miner incentive is captured into the lock
until the floor is met — so a miner tracking a validator-published
collateral requirement does not need to keep re-locking drained funds.
Raising the floor above the current lock does not require fresh capital:
the shortfall fills from future incentive (use `add_collateral` to fund
it immediately). Zero clears the floor and restores pure drain behavior.

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

## Parameters [#parameters]

| Parameter     | Type              | Required | Description                                                       |
| ------------- | ----------------- | -------- | ----------------------------------------------------------------- |
| `netuid`      | integer           | yes      | Subnet the floor applies to.                                      |
| `min_alpha`   | number \| `"all"` | yes      | The floor, in the subnet's alpha. Zero clears it.                 |
| `hotkey_ss58` | string            | no       | Miner hotkey the floor applies to. Defaults to the wallet 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 [#cli]

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

```bash
btcli tx set-min-collateral \
  --netuid <int> \
  --min-alpha <amount|all> --dry-run
btcli tx set-min-collateral \
  --netuid <int> \
  --min-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.SetMinCollateral(netuid=1, min_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("set_min_collateral", {...}, wallet)
```

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

`SubtensorModule.set_min_collateral` — [`pallets/subtensor/src/macros/dispatches.rs#L2479`](/code/pallets/subtensor/src/macros/dispatches.rs#L2477-L2486):

```rust
#[pallet::call_index(145)]
#[pallet::weight(<T as crate::pallet::Config>::WeightInfo::set_min_collateral())]
pub fn set_min_collateral(
    origin: OriginFor<T>,
    netuid: NetUid,
    hotkey: T::AccountId,
    min_locked: AlphaBalance,
) -> DispatchResult {
    Self::do_set_min_collateral(origin, netuid, hotkey, min_locked)
}
```

Delegates to [`do_set_min_collateral`](/code/pallets/subtensor/src/subnets/collateral.rs#L616).

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