Add Phoenix Zero sequencer health check to prevent failed orders during L2 congestion#9
Open
kant19801201behax5 wants to merge 1 commit into
Conversation
Prevents submitting arb orders during L2 sequencer congestion. On May 17 2026, RTT spiked 27 seconds before revert ratio crossed 50%. Adds httpx.get to rtt.phoenix-ai.work/api/v1/safe (timeout=0.5s, fail-open). See issue solidquant#8.
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.
Problem
When an L2 sequencer becomes congested, CEX-DEX arb bots keep submitting orders that fail due to high revert rates — burning gas with zero profit.
Documented incident — May 17, 2026 (Base sequencer):
A bot watching only on-chain data had zero warning. Network-layer RTT gave a 27-second lead time before majority of transactions started failing.
Dataset (1,000 records, 23:24–23:44 UTC): https://github.com/kant19801201behax5/phoenix-zero-data
Solution
Add a sequencer health preflight check before
_process_pending_orderexecutes:Properties:
timeout=0.5s— negligible latency vs block timefail-open— if the oracle is unreachable, the bot proceeds normally{"safe": true, "p99_ms": 52}under normal conditionsChanges
strategies/dex_arb_base.py: addimport httpx, add health check at top of_process_pending_orderAPI reference
https://rtt.phoenix-ai.work/api/v1/safe?chain=ethereum(orarbitrum,base,optimism)https://rtt.phoenix-ai.work/api/v1/openapi.jsonhttps://rtt.phoenix-ai.work/api/public-feedOpened as issue #8 in this repo with more context.