The arbitrage scanner compares spot prices across all 6 supported DEXes and surfaces pairs where the spread exceeds 0.5%. On Monad’s ~400 ms block time, profitable windows can be extremely short - this scanner is designed for low-latency polling or WebSocket-driven triggering.
How It Works
getArbitrageAlertsqueries all DEX pairs and returns alerts wherespreadPct > 0.5%getAllSwapQuotesgives a full breakdown of what each DEX would pay for a specific tradedetectDexArbitragechecks a single token pair and returns the best buy/sell combination
Full Example
Example Output
Checking a Specific Pair
Continuous Scanner with Alerting
Cross-Oracle Price Discrepancy
For a deeper check, combine DEX arbitrage scanning with oracle discrepancy detection:Notes
- Monad’s ~400 ms block time means arbitrage windows close faster than on Ethereum. Target spreads above 0.8% to account for gas costs and execution latency.
getAllSwapQuotesreturns routes sorted byamountOutdescending - the first element is always the best available quote.- OpenOcean is included in the scan but may introduce latency from the REST API call. If speed is critical, filter it out:
quotes.filter(q => q.dex !== 'openocean'). amountOutvalues are returned as strings in wei (token decimals vary - USDC uses 6 decimals, most ERC20s use 18).