feat(pricing): add baseline floor and recalibrate quadratic coefficient#64
Merged
jacderida merged 1 commit intorc-2026.4.1from Apr 7, 2026
Merged
Conversation
Phase 1 pricing recalibration. The legacy formula
`price = (n / 6000)²` produced ~$25/GB at the lower stable boundary
and ~$0/GB when nodes were empty (with only a 1-wei sentinel floor) —
both unreasonable for the current ~\$0.10/ANT token price.
New formula:
price_per_chunk_ANT(n) = BASELINE + K × (n / D)²
with BASELINE = 0.00390625 ANT (spam barrier at empty), K = 0.03515625
ANT (re-anchored coefficient), and D = 6000 (unchanged). The non-zero
baseline removes the need for the legacy MIN_PRICE_WEI = 1 sentinel.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jacderida
approved these changes
Apr 7, 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
Phase 1 pricing recalibration per @jim / @AJ proposal.
The legacy formula
price = (n / 6000)²produced ~$25/GB at the lower stable boundary and ~$0/GB when nodes were empty (only a 1-wei sentinel floor). Both unreasonable at the current ~$0.10/ANT token price.New formula
BASELINEKDPricing at key points
Notes
BASELINEremoves the need for the legacyMIN_PRICE_WEI = 1sentinel; that branch is gone.calculate_pricesignature is unchanged — no call-site updates needed inquote.rsorsingle_node.rs.u128literals; arithmetic usesAmount(U256) withsaturating_mul/saturating_addfor overflow safety onusize::MAXinputs.Test plan
cargo clippy --all-targets --all-features -- -D warnings— cleancargo fmt --all -- --check— cleancargo test --lib payment::pricing— 13/13 (rewritten for the new formula)cargo test --lib payment::— 147/147 (all downstream payment tests)cargo test --test e2e --features test-utils payment— 10/10 (live testnet + Anvil EVM, full quote→pay→verify→store flow)🤖 Generated with Claude Code