Miner incentive tao outflow#5
Draft
igoraxz wants to merge 1 commit into
Draft
Conversation
081d48c to
334d53a
Compare
334d53a to
d864251
Compare
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>
d864251 to
c1f351a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, whereuser_flowis 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 higheruser_flowthan 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:
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)
MinerOriginCredit((netuid, hotkey, coldkey))equal to the value counted at emission.unstake_from_subnet), the credit is consumed pro-rata and reversed out ofSubnetMinerIncentiveFlow. 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.decrease_stake_for_hotkey_and_coldkey_on_subnetreturns 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).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