Transactions

mint-gamma

Mint gamma with TAO into your deposit at an API-key hotkey.

View as Markdown

Buys the subnet's alpha with amount_tao, burns it, and credits its value in gamma, one per US dollar, to the deposit at hotkey_ss58, opening it when absent. The alpha is valued at the lower of the subnet's gamma price and its spot price before the buy. A new deposit's spender is the spender of the subnet owner's service, otherwise the subnet owner, or a leased subnet's beneficiary, unless spender_ss58 names another or service_hotkey_ss58 names a service published on the subnet, whose spender it takes. It has no daily spend cap unless daily_spend_cap_gamma sets one. A mint naming either fails on a deposit with another. Fails rather than minting less than the current quote less rate_tolerance. A plan's preview holds the quote's gamma, minimum_gamma, alpha_burned and tao_value, and the deposit's balance, spender and cap as deposit_balance_gamma (None when the mint opens it), spender_ss58 (None for the default spender) and daily_spend_cap_gamma. The result's data["minted"] holds the deposit's hotkey_ss58, spender_ss58 and daily_spend_cap_gamma, and the alpha_burned, tao_value and gamma minted.

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

Parameters

ParameterTypeRequiredDescription
netuidintegeryesSubnet whose alpha is bought and burned.
hotkey_ss58stringyesHotkey of the deposit credited: an API key, not a staking hotkey.
amount_taonumberyesTAO spent buying the alpha that is burned.
rate_tolerancenumbernoMaximum fall of the minted gamma below the quote, as a fraction (0.05 = 5%).
spender_ss58stringnoThe account that spends the deposit. A new deposit opens with it, and an existing one must already name it. Omit to keep the deposit's spender, which for a new deposit is the spender of the subnet owner's service, otherwise the subnet owner, or its lease's beneficiary while a lease owns the subnet.
service_hotkey_ss58stringnoHotkey of a service published on the subnet, instead of a spender. The deposit names the spender the service publishes.
daily_spend_cap_gammanumbernoThe deposit's daily spend cap, in gamma; 0 pauses it. A new deposit opens with it, and an existing one must already have it. Omit to keep the deposit's cap, which for a new deposit is none.

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

Python

import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.MintGamma(netuid=1, hotkey_ss58="5F...", 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("mint_gamma", {...}, wallet)

On-chain implementation

SubtensorModule.mint_gamma — pallets/subtensor/src/macros/dispatches.rs#L3220:

#[pallet::call_index(158)]
#[pallet::weight((<T as Config>::WeightInfo::mint_gamma(), DispatchClass::Normal, Pays::Yes))]
pub fn mint_gamma(
    origin: OriginFor<T>,
    hotkey: T::AccountId,
    netuid: NetUid,
    amount: TaoBalance,
    min_amount_out: GammaBalance,
    spender: Option<T::AccountId>,
    daily_spend_cap: Option<GammaBalance>,
) -> DispatchResult {
    Self::do_mint_gamma(
        origin,
        hotkey,
        netuid,
        amount,
        min_amount_out,
        spender,
        daily_spend_cap,
    )
}

Delegates to do_mint_gamma.

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