Skip to content

Miner incentive tao outflow#5

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

Miner incentive 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 a per-subnet score user_flow - 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.

Cost normalization (the core of this change)

Each subnet has two costs deducted from its user flow: the protocol cost (EMA of TAO emitted to it, net of root sells) and, new here, the miner-incentive cost (EMA of miner emission counted at the moving alpha price). Both are large relative to user flow, so subtracting them at full value would push almost every subnet's score below zero.

To prevent that, a single normalization factor discounts both costs together, sized so the total cost charged across all subnets equals the total positive user inflow:

factor = sum_i max(user_i, 0)  /  sum_i ( max(protocol_i, 0) + max(miner_i, 0) )      (clamped to <= 1)

score_i = user_i  -  factor * max(protocol_i, 0)  -  factor * max(miner_i, 0)

In words: the network's total deductible cost is capped at total user demand, and that fixed budget is split across subnets pro-rata to each subnet's combined (protocol + miner) cost. This is the same idea as the existing protocol-cost normalization, now extended to include miner incentive under the same factor.

Consequence to be aware of: because the miner cost enters the denominator, enabling it shrinks the factor, which also reduces the protocol deduction on every subnet. So the miner-incentive penalty is relative, not absolute — it redistributes emission share away from high-miner-emission subnets toward low-miner-emission ones, rather than removing a fixed amount from each. (Negative protocol cost — root drain exceeding emissions — is kept as a benefit; a negative miner EMA is floored to 0, since the corresponding sale was already counted as real user outflow.)

Avoiding double-counting (per-position credit + reversal)

  • 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 SubnetMinerIncentiveFlow. 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: no clamp, correct under appreciation (dividends) and dilution. A price-limit partial fill restores credit for the unsold portion (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 (merging), and burn/recycle/dust/AMM-liquidity removal discard it (the emission-time count stands, since that 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).

Config

MinerIncentiveFlowEnabled (default on) gates the miner-incentive cost; all flow EMAs are always updated so toggling causes no shock. sudo_set_miner_incentive_flow_enabled (root, call index 96) is the kill switch. Subnet deregistration clears the credit map; positions with no recorded credit default to zero.

Invariant

Per position, lifetime credit reversed on sales is at most the lifetime credit recorded at emission (consumption is floored, i.e. conservative): miner emission is counted as outflow exactly once.

🤖 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 5 times, most recently from 081d48c to 334d53a Compare June 9, 2026 17:38
@igoraxz igoraxz changed the title Miner burn/recycle tao outflow Miner incentive tao outflow Jun 9, 2026
@igoraxz igoraxz force-pushed the feat/miner-burn-flow branch from 334d53a to d864251 Compare June 9, 2026 18:01
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 SubnetMinerIncentiveFlow accumulator (EMA SubnetEmaMinerIncentiveFlow).
- Cost normalization: one shared factor discounts both the protocol cost and the
  miner-incentive cost before they are subtracted from user flow:
    factor = sum(max(user,0)) / sum(max(protocol,0) + max(miner,0))   (<= 1)
  The total cost charged is capped at total positive user demand and split
  pro-rata by each subnet's (protocol + miner) cost, so the miner term cannot push
  most subnets below eligibility. The penalty is relative: it redistributes share
  toward low-miner-emission subnets rather than an absolute deduction.
- 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 SubnetMinerIncentiveFlow; the real sale is recorded at realized
  price, so each emission unit counts once. Pro-rata + TAO reversal is exact for
  fungible share-pool alpha (no clamp); 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/AMM-removal discard it.
- Owner/burn-hotkey emission is counted but uncredited (destroyed, never sold).
- MinerIncentiveFlowEnabled (default on) gates the miner cost; all flow EMAs are
  kept warm. sudo_set_miner_incentive_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 d864251 to c1f351a Compare June 9, 2026 18:14
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