bridge-monitor: tier-aware gas auto-topup - #1557
Open
Flotapponnier wants to merge 2 commits into
Open
Conversation
- GAS_TOPUP_ENABLED defaults true (tier guard is the safety, not env flag) - CheckAndTopUp now takes tier param; canDivert = stableUSD - tier*1.20 - Gas check runs at every downgrade ladder rung (not just i==0) - Arb USDC->USDT fallback when primary has no balance - topUpChain returns bool; any failure propagates to allOK - spentToday per-chain daily cap, UTC day reset
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
Reworks the native-gas auto-top-up system so it is safe and autonomous:
GAS_TOPUP_ENABLED=true). The tier guard — not an env flag — is the safety mechanism.canDivert = stableUSD - tier × 1.20. If below $5 minimum, sends a Slack alert and leaves the chain gas-blocked.FallbackStable=arbUSDTAddrso Arb ETH shortage still has a funding source.topUpChainnow returnsbool;CheckAndTopUpreturnsbool(false = at least one chain gas-blocked).spentTodaycap (UTC day reset), independent of the triangle rebalancer budget.Wallet context
Sol SOL = $0.75 (below $15 floor). Sol USDC = $248.82. At $50 ladder rung: canDivert = $248.82 - $60 = $188 → swap $25 USDC→SOL via LiFi/Jupiter same-chain swap. System handles this automatically.
Deploy
Bridge-monitor runs on VPS
ocb-par-main, not Railway. After merge to main: rsync harness source +docker build --no-cache ocb-bridge-monitoron the VPS.