Skip to content

Cap chain buys and allocate spillover liquidity-first V2 - #3017

Draft
gzaentz wants to merge 3 commits into
RaoFoundation:mainfrom
gzaentz:codex/cap-chain-buys-miner-emissions
Draft

Cap chain buys and allocate spillover liquidity-first V2#3017
gzaentz wants to merge 3 commits into
RaoFoundation:mainfrom
gzaentz:codex/cap-chain-buys-miner-emissions

Conversation

@gzaentz

@gzaentz gzaentz commented Jul 29, 2026

Copy link
Copy Markdown

Why this change

A subnet's chain buy should fund the productive miner layer, not create unlimited mechanical demand. This PR caps each subnet's chain buy at the spot-TAO value of its unburned miner emissions, while preserving exact block issuance and reallocating rejected TAO to other emitting subnets that can still use it.

This keeps immediate protocol demand tied to miner work and gives lower-ranked networks a deterministic path to liquidity and miner buyback support without removing the largest subnets' emission-weight priority.

Allocation behavior

For each subnet, the planner starts from its original emission-weight allocation:

  1. Fill TAO/alpha liquidity up to the subnet's injection capacity.
  2. Route remaining local TAO to a chain buy.
  3. Cap that chain buy at the TAO value of unburned miner emissions.

Unburned miner emissions are the miner half of alpha emissions after owner cut, reduced by the proportion withheld by MinerBurned in the last settled tempo:

chain_buy_cap = post_owner_cut_alpha × 50% × (1 - MinerBurned) × spot_price

If owner cut is disabled, the miner half is calculated from the full alpha emission. Owner and validator emissions do not increase the cap, and burn/recycle UID withholding reduces it.

TAO rejected by local chain-buy caps is pooled and distributed to positive-emission subnets in descending original emission-weight order, with ascending netuid as the deterministic tie-breaker. For each recipient, spillover first fills remaining TAO/alpha liquidity-injection capacity and then fills the chain buy up to its unburned-miner-emission cap. The allocator advances only after both capacities are full or spillover is exhausted.

Only after every eligible liquidity and chain-buy capacity is full can a terminal remainder enter emission-weighted protocol TAO reservoirs. TAO is never recycled or left unissued. Integer fixed-point remainder is reconciled through the same liquidity-first priority before reservoir allocation.

Materialized emission reporting

The runtime records each subnet's final current-block TAO allocation: materialized liquidity, successful chain buys after spillover, and any current-block terminal reservoir allocation. Dynamic subnet info and metagraph responses now populate their existing emission fields from that final allocation, and stale values are cleared each block. TAO activated later from a prior reservoir is not counted again.

Illustrative mainnet snapshot

At mainnet block 8,725,138 on July 29, 2026, the top 32 subnets received 97.85% of the original TAO allocation. With liquidity-first spillover, they still receive 84.20% of block issuance and retain full buyback coverage for their unburned miner emissions. Their combined allocation falls by 13.96%.

That change redirects 0.06749 TAO per block to ranks 33 through 66. About 0.02688 TAO first fills their remaining liquidity capacity, then 0.04061 TAO funds chain buybacks. This fully covers the TAO value of unburned miner emissions for all 34 subnets. The remaining spillover fills rank 67’s liquidity and partially funds its buyback.

This is the practical tradeoff: the largest subnets keep most issuance and full miner coverage, while a limited reallocation gives lower-ranked networks enough liquidity and buyback support to fund the miners they depend on.

This is a one-block example, not a guarantee of the cutoff under future prices, emission weights, burn rates, or liquidity requirements.

The final simulation conserved exactly 500,000,000 rao, assigned 31,129,431 rao of spillover to liquidity and 69,850,054 rao to buybacks (including 48 rao of integer reconciliation), and assigned 0 rao to terminal reservoirs. Full liquidity and unburned-miner buyback coverage extends through rank 66; rank 67 receives 600,015 rao of liquidity spillover and 205,154 rao of buyback spillover, leaving 139,085 rao of buyback headroom. Ranks 68 through 70 receive no spillover.

Verification

  • Focused spillover tests: 5 passed, 0 failed
  • Focused coinbase tests: 88 passed, 0 failed
  • Full standard pallet-subtensor: 1,344 passed, 0 failed, 9 ignored
  • Full all-features pallet-subtensor: 1,432 passed, 0 failed, 9 ignored; doctests: 0 failed, 7 ignored
  • Full pallet-subtensor-swap: 52 passed, 0 failed, 3 ignored; doctests: 0 failed
  • cargo fmt --all -- --check passed on a byte-identical source snapshot
  • git diff --check passed on the live working tree
  • Final mainnet simulation validations passed for issuance conservation, priority ordering, liquidity-first allocation, chain-buy caps, terminal remainder handling, and zero-emission ineligibility

Remaining requirement before review or merge

The benchmark fixture now includes clearing 128 prior SubnetTaoEmission entries so a production benchmark measures the added storage work. The all-features bench_block_step smoke test passed, but it is not a production measurement.

Before this PR is ready for review or merge, run the measured production runtime block_step benchmark and regenerate the production weight from that measurement. weights.rs is intentionally not updated by this commit; an existing benchmark smoke test is not a substitute for the measured weight update.

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

@gzaentz is attempting to deploy a commit to the RaoFoundation Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant