subnetInfo_getDynamicInfo - Bittensor RPC Method
Retrieve SCALE-encoded dynamic runtime info for a Bittensor subnet. Includes emissions, registration costs, alpha token pricing, and real-time economic data.
Overview
The subnetInfo_getDynamicInfo method returns SCALE-encoded dynamic runtime information for a specific Bittensor subnet. While subnetInfo_getSubnetsInfo returns static configuration, this method returns real-time economic data that changes every tempo: emission rates, registration costs, alpha token pricing, and other values that reflect the current state of the subnet's economy.
This method is essential for understanding the economic dynamics of a subnet -- how much TAO it receives, what it costs to register, and how its internal token (alpha) is priced.
Parameters
| Position | Name | Type | Required | Description |
|---|---|---|---|---|
| 0 | netuid | u16 | Yes | The subnet identifier |
| 1 | at | BlockHash | No | Optional block hash to query at a specific block. Pass null for the latest state |
Response
The result is a JSON array of SCALE bytes. When decoded, the dynamic info structure contains:
| Field | Type | Description |
|---|---|---|
netuid | u16 | The subnet identifier |
owner | AccountId32 | Subnet owner coldkey |
tempo | u16 | Blocks between consensus epochs |
emission_value | u64 | Current emission allocation (RAO per block). Multiply by ~7200 for daily |
burn | u64 | Current registration burn cost (RAO). Divide by 1e9 for TAO |
difficulty | u64 | Current PoW registration difficulty |
alpha_in | u64 | Alpha tokens in the subnet's AMM pool |
alpha_out | u64 | Alpha tokens distributed to stakers |
tao_in | u64 | TAO tokens in the subnet's AMM pool |
price | u64 | Current alpha-to-TAO price (scaled integer) |
k | u64 | Constant product for the AMM pool (alpha_in * tao_in) |
is_dynamic | bool | Whether the subnet uses dynamic TAO pricing |
pending_emission | u64 | Accumulated emissions not yet distributed (RAO) |
pending_alpha_emission | u64 | Pending alpha token emissions |
pending_root_emission | u64 | Pending emissions to root network validators |
network_registered_at | u64 | Block number when this subnet was registered |
subnet_identity | Option<SubnetIdentity> | Optional name/description metadata |
SCALE Decoding
The response decodes to a single SubnetDynamicInfo struct using Bittensor's custom type registry.
Using @polkadot/api: Register the SubnetDynamicInfo type definition. Key types within the struct include AccountId32, u16, u64, bool, and Option<SubnetIdentity>. The SubnetIdentity struct typically contains name (Vec<u8>) and description (Vec<u8>) fields.
Using bittensor Python SDK: Use sub.get_subnet_dynamic_info(netuid=N) which returns a decoded object with all fields accessible as properties.
Key decoding notes:
- The
pricefield represents the alpha-to-TAO exchange rate. The exact scaling factor depends on the runtime version alpha_inandtao_indefine the AMM pool state. The constant productk = alpha_in * tao_indetermines swap pricingpending_emissionaccumulates between tempos. After each tempo, pending emissions are distributed to neurons based on their scoresis_dynamicindicates whether the subnet participates in the dynamic TAO system. Non-dynamic subnets have simpler emission mechanicsnetwork_registered_atis the genesis block for this subnet -- useful for calculating subnet age
Code Examples
Using SubstrateExamples
Decode with Python
import requests
import json
url = 'https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY'
# Fetch dynamic info for subnet 1
payload = {
'jsonrpc': '2.0',
'method': 'subnetInfo_getDynamicInfo',
'params': [1, None],
'id': 1
}
response = requests.post(url, json=payload)
result = response.json()
if result.get('result'):
scale_bytes = result['result']
print(f'Dynamic info SCALE data size: {len(scale_bytes)} bytes')
else:
print('No dynamic info found for this subnet')
# To decode with bittensor SDK:
# import bittensor as bt
# sub = bt.subtensor(network='finney')
# dyn_info = sub.get_subnet_dynamic_info(netuid=1)
# print(f"Emission: {dyn_info.emission_value} RAO/block")
# print(f"Burn cost: {dyn_info.burn / 1e9:.4f} TAO")
# print(f"Alpha price: {dyn_info.price}")Full Python economic analysis
import bittensor as bt
sub = bt.subtensor(network='finney')
# Analyze economics for a specific subnet
netuid = 1
dyn = sub.get_subnet_dynamic_info(netuid=netuid)
current_block = sub.block
print(f"=== Subnet {netuid} Economics ===")
print(f"Owner: {dyn.owner}")
print(f"Registered at block: {dyn.network_registered_at}")
print(f"Subnet age: {current_block - dyn.network_registered_at:,} blocks")
print(f"Tempo: {dyn.tempo} blocks (~{dyn.tempo * 12 / 60:.1f} minutes)")
# Emission analysis
daily_emission_tao = (dyn.emission_value / 1e9) * 7200
print(f"\nEmission: {dyn.emission_value / 1e9:.6f} TAO/block")
print(f"Daily emission: {daily_emission_tao:,.2f} TAO")
print(f"Pending emission: {dyn.pending_emission / 1e9:,.4f} TAO")
print(f"Pending alpha emission: {dyn.pending_alpha_emission / 1e9:,.4f} TAO")
print(f"Pending root emission: {dyn.pending_root_emission / 1e9:,.4f} TAO")
# Registration costs
print(f"\nRegistration burn cost: {dyn.burn / 1e9:,.4f} TAO")
print(f"Registration difficulty: {dyn.difficulty:,}")
# Dynamic TAO / Alpha token economics
if dyn.is_dynamic:
print(f"\nDynamic TAO: Enabled")
print(f"Alpha in pool: {dyn.alpha_in / 1e9:,.4f}")
print(f"TAO in pool: {dyn.tao_in / 1e9:,.4f}")
print(f"Alpha price: {dyn.price}")
print(f"Pool constant k: {dyn.k}")
print(f"Alpha distributed: {dyn.alpha_out / 1e9:,.4f}")
else:
print(f"\nDynamic TAO: Disabled (traditional emission model)")
# Subnet identity
if dyn.subnet_identity:
print(f"\nSubnet name: {dyn.subnet_identity.name}")Decode with JavaScript
import { ApiPromise, WsProvider } from '@polkadot/api';
const provider = new WsProvider('wss://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });
const dynamicInfo = await api.rpc.subnetInfo.getDynamicInfo(1);
console.log('Raw data:', dynamicInfo.toHex().slice(0, 80), '...');
// With Bittensor types registered:
// console.log('Emission:', dynamicInfo.emission_value.toString());
// console.log('Burn:', dynamicInfo.burn.toString());
// console.log('Dynamic TAO:', dynamicInfo.is_dynamic.toString());
// console.log('Alpha price:', dynamicInfo.price.toString());
await api.disconnect();Query with cURL
curl -X POST https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "subnetInfo_getDynamicInfo",
"params": [1, null],
"id": 1
}'Error Handling
| Error Scenario | Behavior | Recommended Action |
|---|---|---|
| Invalid netuid | Returns null result | Use subnetInfo_getSubnetsInfo to list valid netuids |
| Dissolved subnet | Returns null or empty data | Check subnet existence first |
| Non-dynamic subnet | is_dynamic is false, alpha fields may be zero | Handle both dynamic and non-dynamic subnet modes |
| Invalid block hash | Returns JSON-RPC error | Verify block hash exists on chain |
| Node not synced | May return stale economic data | Check system_health for sync status |
| Rate limit exceeded | HTTP 429 | Cache results; refresh once per tempo at most |
Common Use Cases
- Subnet economics — Analyze emission rates, alpha token pricing, and registration costs to understand the economic health of a subnet.
- Emission tracking — Monitor how emissions change over time for a subnet, including pending emissions not yet distributed.
- Registration planning — Check the current burn cost and difficulty before registering a neuron on a subnet.
- Alpha token pricing — Track the alpha-to-TAO exchange rate and AMM pool state for dynamic TAO subnets. Use
alpha_inandtao_into calculate slippage for planned swaps. - Investment analysis — Evaluate subnet economics (emission share, token dynamics) for staking and delegation decisions.
- Dashboard widgets — Display real-time subnet economic indicators in monitoring tools.
- Subnet age analysis — Use
network_registered_atto calculate subnet maturity and correlate with performance metrics.
Related Methods
subnetInfo_getAllDynamicInfo— Get dynamic info for all subnetssubnetInfo_getSubnetsInfo— Get static configuration for all subnetssubnetInfo_getLockCost— Get the TAO lock cost for subnet registrationsubnetInfo_getMetagraph— Get the metagraph topology for a subnetswap_currentAlphaPrice— Get the current alpha token price for swap operations
subnetInfo_getColdkeyAutoStakeHotkey - Bittensor RPC Method
Retrieve the auto-stake hotkey configured for a coldkey on a Bittensor subnet. Used for staking automation, delegation management, and validator operations.
subnetInfo_getLockCost - Bittensor RPC Method
Retrieve the current TAO lock cost required to register a new subnet on the Bittensor network. Essential for subnet creation planning and cost analysis.