Queries

gamma-spent

The gamma a hotkey has spent at a service on a subnet, as an exact decimal string.

View as Markdown

It only grows, until the subnet is dissolved, which clears it. A service crediting spends reads it at a finalized block: (await client.at(await client.finalized_block())).gamma.gamma_spent(...).

Category: Gamma

Parameters

ParameterTypeDescription
netuidintegerSubnet of the service.
service_hotkey_ss58stringHotkey of the service.
hotkey_ss58stringHotkey that spent.

CLI

btcli query gamma-spent --netuid <integer> --service-hotkey <ss58|name> --hotkey <ss58|name> --json

Python

Namespace method (autocomplete, signature help):

import bittensor as bt

sub = bt.Subtensor()
result = sub.gamma.gamma_spent(netuid=1, service_hotkey_ss58="5F...", hotkey_ss58="5F...")

Or dispatch by name, as an agent would:

result = sub.read("gamma_spent", netuid=1, service_hotkey_ss58="5F...", hotkey_ss58="5F...")

Async is the same surface awaited: async with bt.Subtensor() as client:.

On-chain implementation

Every file is browsable under /code exactly as built into the runtime.