# Gamma: subnet service credits (PR #3283)

Gamma is a dollar-valued credit for one subnet's service, minted by burning that subnet's alpha. A customer hotkey holds it like an API key, the subnet charges it as you use the service, and spent gamma is destroyed.

_Source: https://taostats.io/docs/concepts/protocol-changes/gamma_

_Last reviewed: 2026-10-30_

> [!WARNING]
> **Not live on mainnet yet**
>
> This page describes [subtensor PR #3283](https://github.com/RaoFoundation/subtensor/pull/3283), a draft at commit `2b7837479`. Details can change before it merges. Once deployed, gamma stays off until root switches it on network-wide and each subnet owner switches it on for their subnet.

## In one line

Gamma is a credit for one subnet's service, valued in US dollars when it is made. You make it by burning that subnet's alpha. The subnet charges it as you use the service, and charged gamma is destroyed.

## Terms

| Term | Meaning |
|---|---|
| Gamma | The credit. 1 gamma is worth $1 when it is minted. |
| Mint | Make gamma by burning the subnet's alpha. |
| Deposit | The gamma one hotkey holds on one subnet, owned by a coldkey. |
| Spender | The account allowed to charge a deposit. The subnet owner unless the coldkey names someone else. |
| Price oracle | The one account, chosen by root, that posts the TAO/USD price on chain. |
| Service URL | A link a registered hotkey publishes so customers can find a subnet's service. The chain only stores it. |

## Why it exists

Subnets that sell compute, inference or storage each run their own account system off chain: customers prepay into it and trust its billing. Gamma gives every subnet one standard on-chain credit instead. A hotkey works as the API key, balances are visible on chain, and the alpha burned to pay for them can be checked by anyone.

## Who does what

| Role | Can |
|---|---|
| Customer coldkey | Mint into its deposits, move gamma between its own hotkeys, set each deposit's spender and daily cap, close empty deposits |
| Customer hotkey | Holds a deposit and signs requests to the service, like an API key. It doesn't need to be registered on the subnet |
| Provider hotkey | A hotkey registered on the subnet, usually the owner's, that publishes the service URL |
| Spender | Charges the deposits that name it |
| Subnet owner | Switches gamma on for its subnet. Is the default spender (on a leased subnet, the lease beneficiary is) |
| Root | Switches gamma on network-wide and chooses the price oracle |

## Minting gamma

There are two ways, each a single transaction:

| Call | You pay with | What happens |
|---|---|---|
| `mint_gamma` | TAO from your balance | The TAO buys the subnet's alpha, which is burned. No stake is created. It counts as TAO flowing into the subnet, the same as staking |
| `mint_gamma_with_stake` | Alpha you already have staked | That alpha is burned |

The gamma lands in a deposit on the hotkey you choose. If that hotkey has no deposit yet, one opens with the default spender and no daily cap.

Minting needs gamma switched on both network-wide and on the subnet. It doesn't work on the root subnet or on a subnet whose token isn't trading yet.

### How much gamma you get

The burned alpha is valued at the lower of two prices, both read before the mint trades:

- **Spot:** the pool price right now.
- **Gamma price:** a slow price that every subnet keeps. It drops to spot at once when spot falls. When spot rises, it closes half the gap every 600 blocks (about 2 hours), and never more than doubles in that time. A new subnet's gamma price starts at the median subnet alpha price.

**gamma = alpha burned × the lower price × the TAO/USD price**

Because the price is read before the trade and the gamma price climbs slowly, pumping the price in the same block or over a few blocks doesn't increase the gamma you get.

- Minting with TAO: the swap moves the price against you, so you usually get a little less gamma than the dollars you paid.
- Minimum mint: 0.1 gamma. You can also set a minimum you'll accept, and the mint fails below it.
- A TAO mint can't be larger than the largest single stake the pool accepts.

### The TAO/USD price

| Rule | Detail |
|---|---|
| Who posts it | One price oracle account, chosen by root (`sudo_set_tao_usd_price_oracle`) |
| Price falls | The chain accepts a lower price at once |
| Price rises | The accepted price climbs toward a higher feed by at most 0.0066% a block, about 2% an hour |
| Stale feed | Minting stops if the last feed is more than 50 blocks old (about 10 minutes) |

## Spending gamma

1. You send a request to the subnet's service, signed with your hotkey.
2. The service reads that hotkey's deposit.
3. The spender charges the deposit (`spend_gamma`), up to its balance and daily cap.
4. The service serves what was charged.

| Point | Detail |
|---|---|
| Charge first | A spender should charge before serving, because you can change the spender or pause the deposit at any time |
| Batches | One `spend_gamma` call covers up to 512 deposits. Entries it can't charge are skipped, not failed |
| Daily cap | Optional per deposit. It refills evenly over 7,200 blocks (about a day). A cap of 0 pauses the deposit |
| Spent to zero | The deposit stays open with its spender and cap, ready to refill |

## Finding a subnet's service

Any hotkey registered on a subnet can publish a service URL (`set_service_url`), up to 256 bytes. It is limited by the subnet's serving rate limit and paid by the hotkey's coldkey. No chain logic reads the URL: it doesn't affect gamma, charges or emissions, and the chain doesn't mark any URL as official. The owner's hotkey is the one to trust, because it belongs to the subnet owner. The URL is removed when its hotkey is deregistered, and follows a hotkey swap.

Example: a provider runs inference on a subnet.

1. The subnet owner switches gamma on for the subnet.
2. The owner's hotkey publishes a service URL pointing to the API documentation, including which spender to name.
3. You mint gamma onto one of your hotkeys. The spender defaults to the owner; if the documentation names another billing account, you set that as spender.
4. You call the API, signing requests with your hotkey.
5. The spender charges your deposit and the service answers. The charged gamma is destroyed.

## What you can and can't do

| Can | Can't |
|---|---|
| Move gamma between your own hotkeys on one subnet | Send it to another coldkey |
| Let someone else use credits by moving gamma to a hotkey you give them, and take it back at any time | Turn it back into alpha or TAO |
| Hold up to 64 deposits per subnet | Use it on another subnet |

Gamma is deliberately not transferable between coldkeys. A transferable credit would let a subnet push its emissions into another subnet's gamma and sell it.

## Proxies

| Proxy type | Gamma calls allowed |
|---|---|
| `Any` | All |
| `NonCritical` | Mint, move, set spender and cap, close. Not charging |
| `NonTransfer` | Set spender and cap, close. Not minting, moving or charging |
| `GammaSpend` (new) | Charging only |
| `NonFungible` | None |

`set_service_url` is a serving call, so the `Validate` proxy can publish it.

## Effect on the subnet

Minting buys the subnet's alpha (when paying with TAO) and burns it, so alpha supply shrinks and the TAO stays in the subnet pool. Spent gamma pays the subnet nothing further. The value of the burned alpha goes to the subnet's alpha holders. The subnet's own costs are still paid from its emissions.

## Risks

| Risk | Detail |
|---|---|
| Subnet removed | All of the subnet's gamma is destroyed. Holders get nothing |
| No claim | Gamma gives no claim on anyone. Each subnet decides whether, and at what prices, it accepts its gamma |
| Trusted price oracle | A compromised oracle can raise the accepted price by about 2% an hour until root replaces it or switches gamma off |
| Coldkey swap | Your deposits move to the new coldkey. The swap fails if the new coldkey would hold more than 64 deposits on a subnet. While a swap is announced, your own gamma calls are refused, but spenders can still charge you |
| Not checked on chain | The chain records gamma charged, but can't check the service was delivered |

## btcli

```bash
# TAO/USD price, and every gamma deposit of your coldkey
btcli gamma price
btcli gamma list

# Mint with TAO, or with alpha you already have staked
btcli gamma mint --netuid 28 --hotkey <api-hotkey> --amount-tao 10
btcli gamma mint-with-stake --netuid 28 --hotkey <api-hotkey> --origin-hotkey <staking-hotkey> --amount-alpha 50

# Name a spender, or cap daily spending
btcli gamma set-spender --netuid 28 --hotkey <api-hotkey> --spender <spender>
btcli gamma set-cap --netuid 28 --hotkey <api-hotkey> --daily-spend-cap 5
```

## What it means for Taostats data

- **Deposits:** per subnet and per coldkey, with balance, spender and daily cap.
- **Mints:** `GammaMinted` events with TAO paid, alpha burned, value and gamma. TAO mints also count as TAO inflow to the subnet.
- **Burns:** gamma minting is a new source of burned alpha.
- **Charges:** gamma spent per subnet, which is the closest on-chain signal of a subnet's paid usage.
- **Service URLs:** a per-subnet list of published URLs, with the owner's hotkey marked.
- **Prices:** each subnet's gamma price and the accepted TAO/USD price.

Source: [PR #3283](https://github.com/RaoFoundation/subtensor/pull/3283) (`subnets/gamma.rs`, `subnets/tao_usd_price.rs`, `staking/stake_utils.rs`, runtime proxy filters, `btcli gamma`) · [Gamma, explained (Rufus)](https://s3.hippius.com/rufus/public/gamma-explained.html)
