Quality-volume slice and activity-window eligibility (3.4.0) - #727
Merged
Merged
Conversation
Each lane pool now pays (1-beta) on crown time x capacity and beta on the lane's qualified volume share (QUALITY_VOLUME_BETA = 0.25). A completed fill qualifies iff the miner held the lane's crown at the instant it was reserved (its last RESERVE_START on that hub before SwapCompleted), judged at the fill's own size so a swap the seam routed past a too-thin crown holder still counts. The flag is computed at ingest by fill_held_crown - the same reconstruct + crown_holders_at_instant the live snapshot runs - and stored on clearing_rates (new backing + qualified columns). Pools read qualified volume only; unqualified fills neither size a pool nor pay. A lane with no qualified fills in the window recycles its beta slice. The crown event tables keep four hours (EVENT_RETENTION_SECS) instead of one so a reservation instant is still replayable at completion. Score rows carry the qualified share into the existing nullable vol_share column. CAPACITY_CURVE_EXPONENT goes 2.0 -> 1.0: the depth-weighted band already splits crown by collateral, so the convex ramp counted depth twice. Claude-Session: https://claude.ai/code/session_017ZTCEjbjJwe6Te657adCap
Eligibility is now binary on two halves: at most MAX_FAILED_SWAPS lifetime timeouts (the on-chain counter, unchanged) and at least one completed fill in the trailing ELIGIBILITY_FILL_WINDOW_SECS (12 h), read off the validator's clearing ledger. The two-success warm-up is gone: a miner is eligible from its first completed fill and stays so only by delivering - any lane, any taker, qualified or not. A lapsed miner drops out of every crown until its next fill. A validator whose clearing ledger is younger than the window (fresh DB) applies strikes only, so it cannot zero the network while it catches up; the ledger's first-write time is stamped in relay_meta. Claude-Session: https://claude.ai/code/session_017ZTCEjbjJwe6Te657adCap
A lane is live only while its own backing delivered a fill inside the window, so a miner with a dead SOL watcher and a live TAO purse earns on tao lanes alone. The clearing ledger read now groups hotkeys by backing; is_eligible keeps the any-purse global reading (strikes + trace), direction_eligible adds the lane's own purse via purse_active. Single-purse miners see no change. Claude-Session: https://claude.ai/code/session_017ZTCEjbjJwe6Te657adCap
Reverts the k=2 -> 1 change: the squared ramp stays, so thin-parked collateral is penalised harder than the raw ratio and depth is worth posting. Claude-Session: https://claude.ai/code/session_017ZTCEjbjJwe6Te657adCap
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.
Incentive changes from the 09-08 standup: pay quality volume and replace the warm-up with an activity window. Validator-only; no program change, no allways-db migration.
Reward per miner and lane
1. Quality-volume slice (β = 0.25)
fill_held_crownruns the same reconstruct +crown_holders_at_instantthe live snapshot uses, with the reserved miner always a candidate and can-fund bound to the swap'scollateral_amount(a fill the seam routed past a too-thin crown holder still counts). Crown movement after reservation never changes the answer.RESERVE_STARTon that hub beforeSwapCompleted(PoolResolved time); the 30 s pool window is the accepted tolerance. Flag is computed at ingest and stored onclearing_rates(newbacking+qualifiedcolumns).EVENT_RETENTION_SECS) instead of 1 h so a reservation instant is replayable at completion. Score rows write the qualified share into the existing nullablevol_sharecolumn.2. Activity window replaces the warm-up
MIN_SUCCESSFUL_SWAPSis gone. Eligible iff lifetime timeouts ≤MAX_FAILED_SWAPS(unchanged, on-chain) and at least one completed fill in the trailingELIGIBILITY_FILL_WINDOW_SECS(12 h), read off the clearing ledger. Any lane, any taker, qualified or not; timed-out and cancelled swaps don't count.is_eligiblekeeps the any-purse global reading (strikes + trace);direction_eligibleadds the lane's purse viapurse_active.clearing_ledger_sinceinrelay_meta).3. Capacity curve
Unchanged: the convex ramp (k=2) stays. A linear curve was drafted and reverted on review.
Not in this PR (decided)
What to expect on deploy
Follow-ups
compute_direction_poolsfamily share is pair-count-weighted — must become fixed/volume-weighted before [BLOCKED: emissions redesign] Activate alpha-spoke pairs (PR3) #709 activates alpha-spoke pairs.alw miner statushas no view of the activity window; the seam could serve last-fill-per-purse.Tests
2147 passed. New: β slice (
TestQualityVolumeSlice), ledger readers,TestFillHeldCrown(band, size-aware thin holder, busy competitor, crown moving after T, end-to-end ingest), activity window (helper, ledger age, edge of window, per purse e2e).Sister docs PR: entrius/allways-docs-ui (same branch name).
https://claude.ai/code/session_017ZTCEjbjJwe6Te657adCap