Depth-weighted crown rate band (CROWN_RATE_BAND) - #614
Open
anderdc wants to merge 1 commit into
Open
Conversation
Quotes within CROWN_RATE_BAND (0.5%) of the best qualified rate now hold the crown together, splitting each interval in proportion to collateral depth (capped at the full-capacity requirement, so extra depth past a max_swap fill never pays). A one-tick undercut no longer takes a direction outright from a deep miner, which makes depth the axis rivals contest inside the band while a materially better rate (> band) still evicts it and wins alone. Band width is sized from mainnet data: ~0.03% median executed-rate drift within an hour (staleness noise), ~0.5% rate gaps takers demonstrably accept, and ~2.6% between genuine quote tiers. The replay ledger, live crown snapshot, and persisted crown_holders rows all flow through the same crown_depth_shares split, so the dashboard tip cannot diverge from what the scorer pays. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
anderdc
force-pushed
the
feat/crown-rate-band
branch
from
August 4, 2026 14:35
16686ab to
54c4b7d
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.
What
Generalizes the crown's exact-rate tie-break into a rate band: every qualified miner whose quote is within
CROWN_RATE_BAND(0.5%) of the best qualified rate holds the crown together, and each interval's credit splits in proportion to collateral depth via the newcrown_depth_shareshelper.required_collateral(max_swap)— collateral beyond a full-capacity fill buys no extra share (same never-pay-to-win boundcapacity_factorapplies at 1.0).CROWN_RATE_BAND = 0restores exact-best-rate behaviour (band off), tunable inconstants.pywithout redeploy.Why 0.5%
Sized empirically from all 2,011 completed mainnet swaps + live quote ladders (2026-08-03):
The live SOL-TAO ladder's competitive cluster ends at ~0.75% from best; every band width from 0.75% to 2.5% produces identical membership today, and ≥3% starts crediting the 2.6%-worse tier. 0.5% keeps band escape economically live (a genuinely better-priced miner can post +0.6% and take the crown alone) while ending one-tick crown theft.
Consistency
The scoring replay (
credit_interval), the live snapshot (snapshot_current_crown_holders), and the persisted intervals (intervals_to_crown_rows) all flow through the samecrown_holders_at_instant(rate_band=…)+crown_depth_sharespair, so the dashboard tip cannot diverge from the rewarded ledger. Interval rows now carry per-holder proportional credit (still sums to 1.0 per interval, same DB shape); snapshot rows all carry the band's anchor rate.Behaviour change
test_rate_tie_broken_by_collateral(deepest-takes-all on exact tie) is superseded bytest_rate_tie_splits_by_collateral_depth— an exact tie now splits by depth rather than awarding the whole interval to the deepest miner. Dead-heats on rate + collateral still split evenly (degenerate case of the proportional split).Tests
crown_depth_shares: proportional split, full-capacity depth cap, all-zero-depth even fallback.Out of scope (follow-ups)
min_collateralraise (admin tx, no code) and any ε retune once post-band equilibrium data exists — the two levers are deliberately independent.🤖 Generated with Claude Code