Skip to content

feat: normalize protocol cost in net flow EMA#2675

Merged
sam0x17 merged 2 commits into
opentensor:devnet-readyfrom
igoraxz:feat/normalized-protocol-cost
May 20, 2026
Merged

feat: normalize protocol cost in net flow EMA#2675
sam0x17 merged 2 commits into
opentensor:devnet-readyfrom
igoraxz:feat/normalized-protocol-cost

Conversation

@igoraxz
Copy link
Copy Markdown

@igoraxz igoraxz commented May 19, 2026

Summary

Formula

norm_factor = min(1, user_positive_ema_sum / protocol_positive_ema_sum)
net_flow = user_ema - norm_factor * protocol_ema
  • norm_factor self-adjusts each block: more concentration -> it drops -> softer deduction -> rebalances
  • Only positive protocol cost is scaled by norm_factor; negative protocol cost (root drain > emissions) passes through at full value
  • When NetTaoFlowEnabled = 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:

  • Gross flow: 70 -> 53 subnets
  • Net flow (K=1, no normalization): 70 -> 10 subnets (concentration collapse)
  • Net flow (normalized): 70 -> 46 subnets (stable, self-adjusting)

Test plan

  • Verify protocol EMA updates every block regardless of NetTaoFlowEnabled
  • Verify norm_factor = 0 when NetTaoFlowEnabled = false (pure gross flow)
  • Verify norm_factor in [0, 1] when enabled
  • Verify steady-state: with constant flows, net approximates user - protocol (norm_factor -> 1)
  • Verify concentration resistance: fewer qualifying subnets -> norm_factor drops

Generated with Claude Code

@igoraxz igoraxz force-pushed the feat/normalized-protocol-cost branch 6 times, most recently from ba58c40 to 10a9ab7 Compare May 19, 2026 17:51
gztensor
gztensor previously approved these changes May 19, 2026
JohnReedV
JohnReedV previously approved these changes May 19, 2026
@igoraxz igoraxz dismissed stale reviews from JohnReedV and gztensor via be0e319 May 20, 2026 06:17
@igoraxz igoraxz force-pushed the feat/normalized-protocol-cost branch from 10a9ab7 to be0e319 Compare May 20, 2026 06:17
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>
@igoraxz igoraxz force-pushed the feat/normalized-protocol-cost branch from be0e319 to 923fbcd Compare May 20, 2026 06:29
gztensor
gztensor previously approved these changes May 20, 2026
JohnReedV
JohnReedV previously approved these changes May 20, 2026
@JohnReedV JohnReedV added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label May 20, 2026
@JohnReedV JohnReedV dismissed stale reviews from gztensor and themself via f1c6ac8 May 20, 2026 14:55
@sam0x17 sam0x17 merged commit 022a604 into opentensor:devnet-ready May 20, 2026
201 of 204 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants