feat: fastswap sweep redesign#929
Open
owen-eth wants to merge 2 commits into
Open
Conversation
ceadd07 to
f6b9dc3
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.
Describe your changes
Full info on changes: https://www.notion.so/primev/SWEEP_IMPROVEMENTS_PLAN-V2-1-35d6865efd6f809785b9e4d2088ef085?source=copy_link
What this PR does
Backtest result
Two commits for staged deploy
Plan: deploy commit 1's image, verify pod healthy, then deploy commit 2's image, merge after stable.
New components
chainlink_oracle.go— Chainlink Feed Registry for ERC20→ERC20 pricingcost_estimator.go— per-token p25 of realized sweep overhead (refreshed every 30min)gas_buffer.go— in-memory L1 gas observations, persisted for restartsweep_scheduler.go—decideSweepdecision logic +sweepClockwith persistencesweep_loop.go— per-token cadence-based sweep iterator with volume-based overridereconciliation.go— hourly miles-paid vs realized-profit ratio, with per-token breakdownSecurity: attacker-token defense
tokenConfigs)Pricing by swap shape (verified live on mainnet)
surplusis already weiChainlink Registry coverage
Cadence config
Observability
erc20_cycle_summary— per-cycle counts: upfront_awarded, no_profit, deferred breakdown, orphanedawarding upfront erc20 miles— per row: surplus_eth, overhead_eth, net_profit_eth, pricing sourcesweep_executed+sweep_vs_obligation— per-sweep realized profit vs accrued miles obligationreconciliation_metric— hourly aggregate ratio; warn at >1.05 or <0.75reconciliation_per_token— per-token miles obligationcadence_override_triggered— when high-volume override fireschainlink registry lookup failed— once per unsupported tokenWhat's preserved
Out of scope (follow-ups)
Issue ticket number and link
Fixes # (issue)
Checklist before requesting a review