Skip to main content
API referenceSubnets

Deregistration Ranking

Last updated

GET
/api/v1/chain/deregistration-ranking

Fetch the order in which the chain would deregister subnets to make room for a new registration (#10285) — 'how close is this subnet to being pruned', answered with the pallet's own rule rather than a proxy for it. Subtensor::get_network_to_prune() skips root, skips every subnet still inside NetworkRegisteredAt + NetworkImmunityPeriod, compares get_moving_alpha_price, and breaks a tie on the EARLIER registration. TWO THINGS MAKE THIS NOT A PRICE SORT. First, immunity: measured at block 8,808,300, sixteen of 128 subnets were inside their window, and a price-only order puts netuid 86 at position one — it reads a moving price of exactly 0 but cannot be deregistered at all, while the chain's answer is netuid 70. Second, get_moving_alpha_price substitutes a FLAT 1.0 for a Stable subnet (SubnetMechanism 0) instead of reading SubnetMovingPrice, which moves it from the top of a price order to near the bottom; every mainnet subnet reads mechanism 1 today, so the clause is invisible until one sudo call makes it decisive. ranked holds only prunable subnets, rank 1 first. immune holds the protected ones ordered by how soon protection lapses — the order in which they join the ranking — carrying immune_until_block and blocks_until_prunable; ordering them by price would imply a pruning position they do not have. Each entry publishes comparison_price (what the pallet compares) beside moving_price (the raw read), so the Stable substitution is visible. Served live (no static file); 503 when the capture carries no pinned block or no immunity period, because an ordering computed without the immunity window is not an approximation — it is a different ordering that looks the same and would be believed.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/chain/deregistration-ranking"
{  "data": {    "chain_state": {      "block": 5000000,      "block_hash": "0xa3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1",      "emission_bar_quantile": 0.5,      "emission_gate_bar": 0.5,      "emission_gate_exponent": 1,      "network_immunity_period": 1,      "total_issuance_tao": 0.5    },    "field_sources": {      "example": {        "kind": "measured",        "storage": "example"      }    },    "immune": [      {        "blocks_until_prunable": 5000000,        "comparison_price": 0.5,        "immune": false,        "immune_until_block": 5000000,        "moving_price": 0.5,        "netuid": 7,        "rank": 1,        "registered_at_block": 5000000,        "subnet_mechanism": 1      }    ],    "immune_count": 1,    "network_immunity_period": 1,    "next_to_deregister": 1,    "ranked": [      {        "blocks_until_prunable": 5000000,        "comparison_price": 0.5,        "immune": false,        "immune_until_block": 5000000,        "moving_price": 0.5,        "netuid": 7,        "rank": 1,        "registered_at_block": 5000000,        "subnet_mechanism": 1      }    ],    "ranked_count": 1,    "schema_version": 1  },  "meta": {    "artifact_path": "example",    "cache": "short",    "contract_version": "2026-06-29.1",    "generated_at": "2026-06-01T00:00:00.000Z",    "pagination": {      "collection": "example",      "cursor": 1,      "limit": 1,      "next_cursor": 1,      "order": "asc",      "returned": 1,      "sort": "example",      "total": 1    },    "published_at": "2026-06-01T00:00:00.000Z",    "source": "live-cron-prober",    "stale_contract": {      "built_under": "example",      "live": "example"    }  },  "ok": true,  "schema_version": 1}