Docs

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.

PositionNameTypeRequiredDescription
No parameters required

Response

The result is a JSON array of SCALE bytes. When decoded using Bittensor runtime type definitions, each delegate entry contains:

FieldTypeDescription
delegate_ss58AccountId32The delegate's hotkey SS58 address
takeCompact<u16>Delegate's take rate (percentage of emissions retained, in basis points). Default is 1800 (18%). Range: 0--10000
nominatorsVec<(AccountId32, Compact<u64>)>List of nominator accounts and their staked amounts (in RAO, where 1 TAO = 10^9 RAO)
owner_ss58AccountId32The coldkey that owns this delegate hotkey
registrationsVec<Compact<u16>>Subnet netuids where this delegate is registered
validator_permitsVec<Compact<u16>>Subnet netuids where this delegate has validator permits
return_per_1000Compact<u64>Estimated return per 1000 TAO staked (in RAO)
total_daily_returnCompact<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 take field uses basis points: divide by 10000 to get a percentage (e.g., 1800 = 18%)
  • Stake amounts in nominators are in RAO: divide by 1e9 to convert to TAO
  • The return_per_1000 field is also in RAO and represents estimated yield per 1000 TAO staked over a period
  • registrations and validator_permits contain subnet netuid values (u16)
  • The nominators list can be very large for popular delegates (thousands of entries), which is the main driver of response size
  • validator_permits is a subset of registrations -- a delegate can be registered on a subnet without having a validator permit if they do not have enough stake to qualify
  • The owner_ss58 field is the coldkey that controls the delegate hotkey. This is important for identifying the operator behind a delegate
  • total_daily_return is an estimate based on recent emission history and may fluctuate between tempos

Code Examples

Using SubstrateExamples

Decode with Python (bittensor SDK)

Python
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

Python
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)

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 });

// 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

Bash
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 ScenarioBehaviorRecommended Action
Node not syncedReturns stale or empty dataCheck the node's sync status via system_health before querying
Invalid JSON-RPC formatReturns a JSON-RPC error object with code -32600Verify your request payload structure
Method not foundReturns error code -32601Ensure the node supports Bittensor custom RPCs (not all Substrate nodes do)
Timeout on large responseConnection may drop for very slow connectionsIncrease your HTTP client timeout; response can be several MB
Rate limit exceededReturns HTTP 429Implement exponential backoff and cache results (delegate data changes slowly)
Empty resultReturns empty array or nullMay 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_1000 to 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 registrations across 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_getBlockHash and block-specific queries to reconstruct delegate state over time.