Skip to content

Miner burn/recycle tao outflow#5

Draft
igoraxz wants to merge 1 commit into
miner-burn-flow-basefrom
feat/miner-burn-flow
Draft

Miner burn/recycle tao outflow#5
igoraxz wants to merge 1 commit into
miner-burn-flow-basefrom
feat/miner-burn-flow

Conversation

@igoraxz

@igoraxz igoraxz commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

Counts miner emission as virtual user outflow in net TaoFlow, so a subnet that routes miner emission to wallets it controls and holds it does not gain emission share without the sell pressure a subnet pays when its miners sell. Genuine sales of that alpha are counted exactly once (no double-counting).

Why

Net TaoFlow allocates emission by user_flow - protocol_cost, where user_flow is an EMA of buys minus sells. Miner emission that is held (not sold) creates no sell pressure, so a subnet that diverts miner emission to a controlled wallet and holds it keeps a higher user_flow than a subnet whose miners receive and sell their emission. Counting miner emission as virtual outflow removes that asymmetry.

Mechanism

  • Every miner incentive (all UIDs) is counted as outflow at emission time, valued at the moving (EMA) alpha price (smoothed over a window, so a flash dump or pump at the epoch block cannot move it), and accumulated into the signed SubnetMinerBurnFlow. Its EMA is subtracted from the subnet's user flow.
  • Miner alpha staked to a wallet is tagged with a per-position TAO credit MinerOriginCredit((netuid, hotkey, coldkey)) equal to the value counted at emission.
  • When that alpha is genuinely sold (unstake_from_subnet), the credit is consumed pro-rata and reversed out of SubnetMinerBurnFlow. The real sale is recorded as user outflow at its realized price, so each unit of emission contributes to outflow once: at emission if held, or at the realized sale value if sold.
  • Pro-rata consumption with TAO-denominated reversal is exact for fungible share-pool alpha: it needs no clamp and remains correct as a position's alpha value drifts up (dividends) or down (dilution). On a price-limit partial fill, credit for the unsold portion is restored (rounded so the reversal is never over-counted).
  • decrease_stake_for_hotkey_and_coldkey_on_subnet returns the credit it consumed; callers route it: a sale reverses it, a same-subnet transfer and hotkey/coldkey swaps carry it to the destination position (merging), and burn/recycle/dust removal discards it (the emission-time count stands, since destroyed alpha is never sold).
  • Emission routed to the subnet owner/burn hotkey is counted as outflow but uncredited (it is destroyed and never reaches a seller).
  • MinerBurnFlowEnabled (default on) gates the subtraction from user flow; the EMA is always updated so toggling causes no shock. sudo_set_miner_burn_flow_enabled (root, call index 96) is the kill switch. Subnet deregistration clears the credit map for the netuid. Positions with no recorded credit default to zero, so their alpha counts as outflow on sale.

Invariant

Per position, lifetime credit reversed on sales is at most the lifetime credit recorded at emission (consumption is floored, i.e. conservative). Equivalently: miner emission is counted as outflow once — at emission if held, or via the realized sale otherwise — and never twice.

🤖 Generated with Claude Code

@igoraxz igoraxz changed the title Miner burn flow: count burned miner emission as virtual user outflow Miner burn/recycle tao outflow Jun 8, 2026
@igoraxz igoraxz force-pushed the feat/miner-burn-flow branch 3 times, most recently from bc6abad to 7fdad8f Compare June 9, 2026 15:35
Count miner emission as virtual user outflow in net TaoFlow, so a subnet that
routes miner emission to wallets it controls and holds it does not gain emission
share without the sell pressure a subnet pays when its miners sell. Genuine
sales of that alpha are counted exactly once.

- Every miner incentive (all UIDs) is counted as outflow at emission, valued at
  the moving (EMA) alpha price (smoothed -> resists epoch-block dump/pump), into
  the signed SubnetMinerBurnFlow accumulator whose EMA is subtracted from user
  flow.
- Miner alpha staked to a wallet is tagged with a per-position TAO credit
  MinerOriginCredit((netuid,hotkey,coldkey)) equal to the value counted.
- On a genuine sale (unstake_from_subnet) the credit is consumed pro-rata and
  reversed out of SubnetMinerBurnFlow; the real sale is recorded at realized
  price, so each emission unit counts once (at emission if held, at realized
  value if sold). Pro-rata + TAO reversal is exact for fungible share-pool alpha
  (no clamp; correct under appreciation and dilution); the price-limit refund
  restores credit for the unsold portion (rounded so reversal never over-counts).
- decrease_stake_for_hotkey_and_coldkey_on_subnet returns the consumed credit;
  callers route it -- sale reverses, same-subnet transfer and hotkey/coldkey
  swaps carry it to the destination (merging), burn/recycle/dust discard it.
- Owner/burn-hotkey emission is counted but uncredited (destroyed, never sold).
- MinerBurnFlowEnabled (default on) gates the user-flow subtraction; the EMA is
  always kept warm. sudo_set_miner_burn_flow_enabled (root, call index 96).
  Dereg clears the credit map; positions with no credit default to zero.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@igoraxz igoraxz force-pushed the feat/miner-burn-flow branch from 7fdad8f to 081d48c Compare June 9, 2026 15:45
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