lium fund
Add funds with TAO, alpha or SN51 gamma from your Bittensor wallet. Run with no flags, lium fund prompts for a TAO payment. To pay with gamma interactively, start with lium fund --gamma.
With --alpha, only free alpha moves. Ask for more than you have free and nothing is credited.
Usage
lium fund [OPTIONS]
Flags
| Flag | What it does |
|---|---|
-w, --wallet NAME | Wallet to pay from |
-a, --amount AMOUNT | TAO, USD with --alpha, or the USD target with --gamma: the credit is the gamma actually minted and spent |
--alpha | Pay with free alpha instead of TAO |
--gamma | Pay with SN51 gamma minted from the wallet's TAO; Lium credits 1 USD per gamma spent |
-k, --hotkey HOTKEY | Hotkey the alpha is staked under (required with --alpha) |
--netuid N | Subnet whose alpha pays (with --alpha; default: Lium's subnet) |
-y, --yes | Send without asking |
--json | Print the result as JSON |
Example
lium fund -w default -a 10
Pay with gamma
lium fund --gamma -w default -a 25 targets a 25 USD top-up paid with SN51 gamma. Lium credits the gamma actually minted and spent, so the credit depends on the quote and the price at inclusion and can be less than the target. The confirmation prompt names the minimum gamma the mint must give, rounded to two decimals; the chain enforces the unrounded minimum, so a mint can succeed slightly below the figure shown; a mint below the unrounded minimum fails (on runtime 493 and later it also fails, and is reverted, if the spend in the same batch fails). Lium credits gamma that is actually spent. It needs lium.io 0.46.8 or later and the Bittensor chain stack; if the stack is missing, the command names the install command for your setup. --alpha, --hotkey and --netuid do not apply.
- It quotes how much TAO mints the amount and asks you to confirm. The mint fails, costing only the fee, if it would give more than 2% less gamma than quoted.
- It links the wallet's coldkey to your Lium account; the coldkey's address serves as the gamma hotkey. The link persists, but every top-up signs a fresh link challenge with the coldkey, so the CLI must be logged in with an API key the account owner created in their personal workspace, with the
billingscope and no spending budget. A key with a budget is refused, and so is any team-workspace key. - It mints the gamma from the wallet's TAO with one signature:
- On subtensor runtime 493 and later, the same transaction spends the gamma at Lium's service on SN51. If the spend fails, the mint is reverted. The CLI then attempts to spend any gamma the mint gave above the minimum, as a separate signed spend. The first payment stands even if that spend fails or its outcome is unknown. If it failed, the CLI warns "Paid, but the gamma left in the deposit was not spent" (with
--json:gamma_rest_spentandgamma_rest_pendingare 0); the remainder stays in the deposit. To credit it without minting again, use Credit the rest of my deposit under Billing → Add funds; otherwise it is spent along with your next top-up. If its outcome is unknown, the CLI warns "Paid. Spending the … gamma left in the deposit may still land" (with--json:gamma_rest_pendingis that amount); it may still land, so check the wallet's finalized transaction history before doing anything else. Until it has settled, the nextlium fund --gammafrom the same coldkey on the same machine exits without sending. In both cases do not runlium fund --gammaagain just to recover the difference: that mints and pays a whole new amount. - Before runtime 493, the gamma goes to a deposit Lium is allowed to spend.
- On subtensor runtime 493 and later, the same transaction spends the gamma at Lium's service on SN51. If the spend fails, the mint is reverted. The CLI then attempts to spend any gamma the mint gave above the minimum, as a separate signed spend. The first payment stands even if that spend fails or its outcome is unknown. If it failed, the CLI warns "Paid, but the gamma left in the deposit was not spent" (with
Lium credits 1 gamma = 1 USD, usually within a few minutes. Before runtime 493, a deposit with a positive daily spend cap is also credited only as far as the cap allows, and the rest as the cap refills. Check with lium balance.
In 0.46.x, --json requires --yes. On exit 0 the last line on stdout is the JSON object (a remainder warning can print text before it); tx.gamma_rest_spent and tx.gamma_rest_pending report the remainder. If you cannot parse it, check lium balance and the wallet's transaction history; a parse error is not a reason to pay again.
If the answer from the chain is lost, the CLI keeps a note of the payment on this machine. While that transaction is unresolved, the next lium fund --gamma from the same coldkey on the same machine exits without sending; another machine has no such note and will sign a new payment. Before paying again, check the wallet's finalized transaction history and lium balance; retry only after confirming the first payment failed or expired.
Before runtime 493, a mint into a deposit whose daily spend cap is zero can land and get no credit until the cap is raised: the CLI does not check the cap before signing, and Lium skips a deposit with no spendable gamma.