feat: normalize protocol cost in net flow EMA#2675
Merged
sam0x17 merged 2 commits intoMay 20, 2026
Conversation
ba58c40 to
10a9ab7
Compare
gztensor
previously approved these changes
May 19, 2026
JohnReedV
previously approved these changes
May 19, 2026
10a9ab7 to
be0e319
Compare
Normalizes protocol EMA so that its positive total matches user EMA positive total before computing net flow. This prevents subsidy concentration: as emissions concentrate on fewer subnets their protocol EMA grows, but the normalization factor shrinks to compensate. norm_factor = min(1, sum(max(user_ema_i, 0)) / sum(max(proto_ema_i, 0))) net_flow_i = user_ema_i - norm_factor * protocol_ema_i norm_factor is computed each block from current EMA state. No tunable parameters. Guarantee: non-negative aggregate net signal over gross-positive subnets. Individual subnets can still be filtered when their protocol cost exceeds their user demand. Simulation result: 70 -> 46 subnets (vs 10 without normalization). Also fixes opentensor#2667: protocol EMA is now updated unconditionally for all subnets regardless of NetTaoFlowEnabled. The flag only controls whether the normalized deduction is applied. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
be0e319 to
923fbcd
Compare
gztensor
previously approved these changes
May 20, 2026
JohnReedV
previously approved these changes
May 20, 2026
JohnReedV
approved these changes
May 20, 2026
sam0x17
approved these changes
May 20, 2026
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
NetTaoFlowEnabledtoggle injects accumulatedSubnetProtocolFlowinto the EMA as a single block #2667: protocol EMA now updated unconditionally (accumulator no longer shocks on toggle)Formula
norm_factorself-adjusts each block: more concentration -> it drops -> softer deduction -> rebalancesnorm_factor; negative protocol cost (root drain > emissions) passes through at full valueNetTaoFlowEnabled = false,norm_factor = 0(pure gross flow)Guarantee
Non-negative aggregate net signal over gross-positive subnets. Individual subnets can still be filtered when their protocol cost exceeds their user demand -- the guarantee is on the set, not per-subnet.
Proof: sum of net_i over {user > 0} = sum of user_i - norm_factor * sum of protocol_i. Since sum of protocol_i (over user > 0) <= protocol_positive_ema_sum, and norm_factor * protocol_positive_ema_sum <= user_positive_ema_sum (by construction), the sum is non-negative.
Simulation
41-day simulation with full emission redistribution:
Test plan
NetTaoFlowEnablednorm_factor = 0whenNetTaoFlowEnabled = false(pure gross flow)norm_factorin [0, 1] when enabledGenerated with Claude Code