delegateInfo_getDelegates - Bittensor RPC Method
Retrieve a SCALE-encoded list of all registered delegates on the Bittensor network. Essential for staking dashboards, delegate discovery, and yield analysis.
Overview
The delegateInfo_getDelegates method returns a SCALE-encoded byte array containing information about every registered delegate on the Bittensor network. Delegates are hotkeys that have registered to accept TAO stake from other accounts (nominators). This method is the primary way to discover all available delegates for staking decisions.
In Bittensor, delegation is a core economic mechanism. TAO holders who do not run their own validators can delegate their stake to a delegate hotkey and earn a share of the delegate's emissions. Each delegate sets a take rate (percentage of emissions they keep), making this data critical for yield optimization.
Delegates are distinct from regular validators in that they have explicitly opted in to accept external nominations. Not every validator is a delegate -- only those who have called the become_delegate extrinsic. The default take rate is 18% (1800 basis points), but delegates can adjust this between 0% and 100%. When evaluating delegates, consider both the take rate and the delegate's total emissions across subnets.
The data returned by this method includes each delegate's subnet registrations, allowing you to see which subnets a delegate is active on, which subnets they hold validator permits for, and how their stake and emissions are distributed.
Parameters
This method takes no parameters.
| Position | Name | Type | Required | Description |
|---|---|---|---|---|
| — | — | — | — | No parameters required |
Response
The result is a JSON array of SCALE bytes. When decoded using Bittensor runtime type definitions, each delegate entry contains:
| Field | Type | Description |
|---|---|---|
delegate_ss58 | AccountId32 | The delegate's hotkey SS58 address |
take | Compact<u16> | Delegate's take rate (percentage of emissions retained, in basis points). Default is 1800 (18%). Range: 0--10000 |
nominators | Vec<(AccountId32, Compact<u64>)> | List of nominator accounts and their staked amounts (in RAO, where 1 TAO = 10^9 RAO) |
owner_ss58 | AccountId32 | The coldkey that owns this delegate hotkey |
registrations | Vec<Compact<u16>> | Subnet netuids where this delegate is registered |
validator_permits | Vec<Compact<u16>> | Subnet netuids where this delegate has validator permits |
return_per_1000 | Compact<u64> | Estimated return per 1000 TAO staked (in RAO) |
total_daily_return | Compact<u64> | Total daily emissions earned by this delegate (in RAO) |
SCALE Decoding
The raw response is a JSON array of SCALE bytes that must be decoded before use. There are two main approaches:
Using @polkadot/api (JavaScript/TypeScript): Register Bittensor custom types before creating the API instance. The Bittensor node exposes its type definitions through the RPC metadata. In practice, define a local type bundle or custom registry entry for DelegateInfo, then decode the payload as Vec<DelegateInfo> with createType or registry.createType.
Using scalecodec (Python): The bittensor Python SDK wraps SCALE decoding internally. If you need manual decoding, use the scalecodec library with a Bittensor-specific type registry that defines DelegateInfo as a struct containing the fields listed above.
Key decoding notes:
- The
takefield uses basis points: divide by 10000 to get a percentage (e.g.,1800= 18%) - Stake amounts in
nominatorsare in RAO: divide by1e9to convert to TAO - The
return_per_1000field is also in RAO and represents estimated yield per 1000 TAO staked over a period registrationsandvalidator_permitscontain subnet netuid values (u16)- The
nominatorslist can be very large for popular delegates (thousands of entries), which is the main driver of response size validator_permitsis a subset ofregistrations-- a delegate can be registered on a subnet without having a validator permit if they do not have enough stake to qualify- The
owner_ss58field is the coldkey that controls the delegate hotkey. This is important for identifying the operator behind a delegate total_daily_returnis an estimate based on recent emission history and may fluctuate between tempos
Code Examples
Using SubstrateExamples
Decode with Python (bittensor SDK)
import requests
import json
# Query all delegates via JSON-RPC
url = 'https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY'
payload = {
'jsonrpc': '2.0',
'method': 'delegateInfo_getDelegates',
'params': [],
'id': 1
}
response = requests.post(url, json=payload)
result = response.json()
# The result is a JSON array of SCALE bytes
scale_bytes = result['result']
print(f'Response size: {len(scale_bytes)} bytes')
# To decode, use the bittensor SDK:
# import bittensor as bt
# sub = bt.subtensor(network='finney')
# delegates = sub.get_delegates()
# for d in delegates[:5]:
# print(f"Delegate: {d.hotkey_ss58}, Take: {d.take}, Nominators: {len(d.nominators)}")Full Python example with analysis
import bittensor as bt
sub = bt.subtensor(network='finney')
delegates = sub.get_delegates()
# Sort delegates by total stake (descending)
delegates_sorted = sorted(delegates, key=lambda d: d.total_stake, reverse=True)
# Display top 10 delegates
print(f"{'Hotkey':<20} {'Take %':>8} {'Nominators':>12} {'Total Stake (TAO)':>20}")
print("-" * 64)
for d in delegates_sorted[:10]:
take_pct = d.take * 100
total_tao = d.total_stake.tao
print(f"{d.hotkey_ss58[:18]}.. {take_pct:>7.1f}% {len(d.nominators):>12} {total_tao:>20,.2f}")
# Calculate network-wide delegation statistics
total_delegated = sum(d.total_stake.tao for d in delegates)
avg_take = sum(d.take for d in delegates) / len(delegates) * 100
print(f"\nTotal delegates: {len(delegates)}")
print(f"Total TAO delegated: {total_delegated:,.2f}")
print(f"Average take rate: {avg_take:.1f}%")Decode with JavaScript (@polkadot/api)
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 });
// Call the custom RPC method
const result = await api.rpc.delegateInfo.getDelegates();
// The result is SCALE-encoded; decode with Bittensor type registry
// Register Bittensor types before creating the API instance for automatic decoding
console.log('Raw SCALE result length:', result.length);
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": "delegateInfo_getDelegates",
"params": [],
"id": 1
}'Error Handling
| Error Scenario | Behavior | Recommended Action |
|---|---|---|
| Node not synced | Returns stale or empty data | Check the node's sync status via system_health before querying |
| Invalid JSON-RPC format | Returns a JSON-RPC error object with code -32600 | Verify your request payload structure |
| Method not found | Returns error code -32601 | Ensure the node supports Bittensor custom RPCs (not all Substrate nodes do) |
| Timeout on large response | Connection may drop for very slow connections | Increase your HTTP client timeout; response can be several MB |
| Rate limit exceeded | Returns HTTP 429 | Implement exponential backoff and cache results (delegate data changes slowly) |
| Empty result | Returns empty array or null | May indicate no delegates are registered (unlikely on mainnet) or node issue |
When integrating this method, cache the response and refresh periodically (every few minutes) rather than polling on every user request. Delegate data changes at most once per tempo (approximately 12 seconds per block, with tempos of 100+ blocks).
Response size considerations: On mainnet with hundreds of active delegates, each with potentially thousands of nominators, the response can exceed 5 MB. Plan your HTTP client buffer sizes and parsing strategy accordingly. For bandwidth-constrained environments, consider querying individual delegates via delegateInfo_getDelegate instead.
Common Use Cases
- Staking dashboards — Display all available delegates with their take rates, total stake, and nominator counts so users can choose where to delegate TAO.
- Delegate discovery — Help new TAO holders find active, well-performing delegates across different subnets.
- Yield analysis — Compare delegate returns, take rates, and historical performance to optimize staking yield. Use
return_per_1000to estimate annualized yields. - Network analytics — Track total delegation across the network, concentration of stake, and delegate activity. Identify the Nakamoto coefficient for delegation.
- Validator monitoring — Monitor which subnets delegates are registered on and whether they hold validator permits. Alert when delegates lose permits.
- Subnet coverage analysis — Identify which subnets have the most delegate coverage and which are underserved by comparing
registrationsacross all delegates. - Take rate alerts — Monitor delegate take rates for changes. A delegate lowering their take may signal increased competition for nominations; a raise may indicate reduced yield for nominators.
- Nominator concentration — Analyze the distribution of stake across nominators for each delegate. High concentration (few large nominators) versus wide distribution affects risk for smaller stakers.
- Historical snapshots — While this method does not accept a block hash parameter directly, you can use it alongside
chain_getBlockHashand block-specific queries to reconstruct delegate state over time.
Related Methods
delegateInfo_getDelegate— Get info for a single delegate by hotkey (lighter than fetching all)delegateInfo_getDelegated— Get delegations made by a specific coldkey accountsubnetInfo_getMetagraph— Get the metagraph for a subnet (includes validator/miner data)subnetInfo_getSubnetsInfo— Get configuration info for all subnets (complements delegate data)subnetInfo_getDynamicInfo— Get dynamic subnet economics (emissions that delegates earn)neuronInfo_getNeuron— Get detailed neuron info by UID within a subnetswap_currentAlphaPrice— Get the current alpha token price for a subnet
delegateInfo_getDelegated - Bittensor RPC Method
Retrieve SCALE-encoded delegations for a specific account on Bittensor. Essential for portfolio tracking, staking analytics, and nomination monitoring.
neuronInfo_getNeuron - Bittensor RPC Method
Retrieve SCALE-encoded detailed information for a specific neuron by UID within a Bittensor subnet. Essential for miner/validator monitoring and performance tracking.