An n8n-powered automated arbitrage detection and analysis system that monitors price spreads across five decentralized exchanges in real time. Operates in paper trading mode for educational and research purposes, with ML-based threshold optimization, gas cost analysis, and a Bootstrap dashboard for performance visualization.
This page documents the Velocity-BPA Cross-DEX Arbitrage Bot Suite — a multi-workflow automation system built on n8n and Airtable. The system detects price discrepancies for the same asset across multiple DEX platforms, evaluating whether spreads exceed gas costs and slippage to represent a profitable opportunity. All trades are tracked in paper trading mode; no on-chain execution occurs.
The system monitors five exchanges: Uniswap, SushiSwap, 1inch, OKX DEX, and Kraken. Price data is collected every 30 seconds via external API feeds, with opportunities filtered through dynamic thresholds calibrated by a machine learning engine trained on accumulated historical data. Observed profitable spreads in paper trading typically fall in the 0.3–1.5% range.
The suite comprises eight interconnected n8n workflows, each running on its own schedule.
The primary workflow runs on a 30-second interval. It fetches live price data from all five exchanges, validates inputs against realistic price ranges to eliminate corrupted feed data, computes cross-exchange spread percentages, and routes all detected opportunities to Airtable. Opportunities that exceed the current ML-generated threshold are additionally flagged for execution pipeline analysis. Data routing uses parallel paths to preserve raw opportunity records while isolating the execution pipeline.
Runs every 5 minutes. Evaluates active opportunity exposure against configured capital limits, calculates correlation risk across trading pairs, and generates risk assessment records. Prevents over-concentration in correlated asset positions.
Runs every 15 minutes. Queries the Etherscan Gas API V2 for current network conditions and computes the minimum spread required to remain profitable after gas fees, exchange fees, and estimated slippage. Updates the dynamic threshold consumed by the arbitrage monitor, suppressing low-quality signals during high-fee network periods.
Runs every 4 hours. Aggregates historical execution data by exchange, calculating fill rates, average latency, and realized spread accuracy. Results inform exchange weighting and data source prioritization decisions.
Generates a daily summary of detected opportunities, profitable signals, simulated P&L, and system health metrics. Output is stored in the Daily_Performance table.
Processes accumulated historical opportunity data to derive optimal detection thresholds for prevailing market conditions. Requires a minimum of 100 historical samples before confidence scores stabilize. At full training capacity, the model converges on an optimal spread threshold near 1.5% with maximum confidence. Three threshold strategies are maintained simultaneously — conservative, standard, and aggressive — mapped to market volatility conditions. Thresholds are written to ML_Thresholds and consumed by the arbitrage monitor at runtime.