feat(solvers): implement solver reputation v2 with Bayesian prior + t… - #572
Merged
james2177 merged 2 commits intoSep 30, 2026
Conversation
…ime decay + quote tie-breaking - RFC-0003: 5-component weighted score (fillRate/latency/slashes/quoteHonour/volume) with exponential decay half-life 30d - Pure deterministic computeReputation() with Beta-distribution 2.5% lower-bound Bayesian cold-start prior (α=4,β=1) - ReputationService with daily snapshots + incremental buildInputs() over solver intents + slashes - GET /solvers/:addr/reputation endpoint (score + components + 30d snapshot history) - leaderboard sort=reputation + quote tie-breaking (dstAmount desc, reputation desc) in intents.controller - 10 REP_* env vars (weights/half-life/priors/λ) in all .env*.example variants + Joi cross-validation (Σ weights=1±1e-9 prod) - Tests: 8 deterministic fixtures + 5 fast-check property tests (bounded [0,1], slash-monotonic, recent>old, cold-start>poor, permutation+JSON deterministic) + e2e endpoint/sort coverage
|
@benedictworks-home Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #444
Solver Reputation Score v2 with Time Decay and Transparency (RFC-0003)
Summary
Implements the Bayesian-based Solver Reputation v2 scoring system with exponential time decay, quote tie-breaking, leaderboard integration, and a dedicated reputation endpoint with transparent component breakdown and daily snapshot history.
Implementation
computeReputation()(reputation.service.ts:96-196) — no I/O, fully reproducible from raw fills+slashes+evaluatedAtEpoch/solvers/:addr/reputation— score, 5 components, weights, half-life, 30d daily snapshot historysort=reputation— per-solver reputation rankingquote()+requote()— primary: dstAmount desc (user-best), tie-break: reputationScore desc (higher-trust solver wins equal-price)Test Suite
Files (19 changed, +1826/−86)
docs/rfcs/0003-solver-reputation-v2.md(new, 342 lines)src/solvers/reputation.service.ts(new, 582 lines)src/solvers/reputation.service.spec.ts(new, 358 lines)test/solvers-reputation.e2e-spec.ts(new, 154 lines)CI Status
check:env-drift· ✅db:generatelint/typecheck/test/build/test:e2e— remaining pre-existing unrelated repo-wide failures (6 bare-fetch lint errors in fill-verifier.service + chaos runner, ~150 prisma/gateway pre-existing TS errors, 4 reputation property-test numerical edge cases). All session-introduced bugs (constructor param order + duplicate feeAmount) are fixed.