2.2 Detection Pipeline
Fetch → Normalize → Calculate → Filter → Display
This is the actual logic, 1:1 with the repo.
2.2.1 Fetch – Data Sources
Capture Engine continuously fetches live prices from:
Jupiter Aggregator API – cross-DEX quotes.
Raydium API – AMM pools.
Orca API – concentrated liquidity AMM.
Phoenix API – central limit order book.
The engine polls these APIs at a configurable interval (default: every 2 seconds).
2.2.2 Normalize – Unified Representation
Different DEXs expose:
Different JSON shapes
Different pair naming conventions
Different decimal formats
The engine normalizes this into a unified internal format:
Standard pair notation (e.g.
SOL/USDC).Comparable price units across DEXs.
Cleaned data structures that can be fed directly into the calculation step.
2.2.3 Calculate – Spreads & Net Profit
For every pair and DEX combination, Capture Engine computes:
Spread % – raw price difference between buy venue and sell venue.
Profit % – estimated net profit after fees & expected slippage.
Basis points (bps) – profit translated into trading units (100 bps = 1%).
This is where “SOL is cheaper here, more expensive there” turns into a numeric edge you can sort and rank.
2.2.4 Filter – Noise Removal
To avoid spamming you with garbage:
Opportunities with profit below
min_profit_threshold(default 0.1%) are dropped.Only pairs and venue routes that clear the bar are passed forward.
You control how aggressive this filter is (details in 2.5 Configuration).
2.2.5 Display – Real-Time Terminal Output
Filtered opportunities are streamed to the terminal in real time, in a compact format like:
[16:15:02] SOL/USDC | jupiter@0.008822 → raydium@0.003801 | spread -56.91% | profit 1.20% (120bps)
Stats: 20 opportunities | Avg: 0.75% | Best: 2.30%
You get:
Per-opportunity lines (what to buy where, what to sell where, estimated profit).
A rolling stats line summarizing how the engine is performing (count, average profit, best profit).
Last updated

