Skip to content

Depth-weighted crown rate band (CROWN_RATE_BAND) - #614

Open
anderdc wants to merge 1 commit into
testfrom
feat/crown-rate-band
Open

Depth-weighted crown rate band (CROWN_RATE_BAND)#614
anderdc wants to merge 1 commit into
testfrom
feat/crown-rate-band

Conversation

@anderdc

@anderdc anderdc commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

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 new crown_depth_shares helper.

  • A one-tick undercut no longer takes 100% of a direction from a deep miner — evicting the band requires a rate more than 0.5% better, so depth becomes the contested axis inside the band while genuinely better pricing still wins outright.
  • Depth is capped at required_collateral(max_swap) — collateral beyond a full-capacity fill buys no extra share (same never-pay-to-win bound capacity_factor applies at 1.0).
  • Proportional splitting is sybil-neutral: splitting one collateral pile across N hotkeys yields exactly the same total share, minus N× the fee overhead.
  • CROWN_RATE_BAND = 0 restores exact-best-rate behaviour (band off), tunable in constants.py without redeploy.

Why 0.5%

Sized empirically from all 2,011 completed mainnet swaps + live quote ladders (2026-08-03):

anchor value role
rate tick (5 sig figs) 0.002–0.01% sniping granularity the band must dwarf
median executed-rate drift, <1h 0.004–0.03% honest quote staleness the band must absorb
rate distance takers actually accepted (p50–p75 vs same-6h-bucket best) 0.02–1.5% differences below ~0.5% demonstrably don't decide routing
gap to the next genuine quote tier ~2.6% materially worse pricing the band must exclude

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 same crown_holders_at_instant(rate_band=…) + crown_depth_shares pair, 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 by test_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

  • Band membership: near-rates join (both sort directions), band anchors on best qualified rate (a busy leader can't strand the band), unqualified members excluded, band 0 = exact-only.
  • crown_depth_shares: proportional split, full-capacity depth cap, all-zero-depth even fallback.
  • End-to-end: thin 0.4% undercut inside the band shares 1/6 instead of taking all; deep quote keeps 5/6; a 1.5% quote outside the band earns nothing.
  • Full suite: 848 passed.

Out of scope (follow-ups)

  • allways-db / UI: crown snapshot & holder rows are shape-compatible but the UI may want to render multiple concurrent holders with fractional credit.
  • min_collateral raise (admin tx, no code) and any ε retune once post-band equilibrium data exists — the two levers are deliberately independent.

🤖 Generated with Claude Code

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
anderdc force-pushed the feat/crown-rate-band branch from 16686ab to 54c4b7d Compare August 4, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant