Quote Drift Tracker is a Python-based application designed to analyze MEV (Maximal Extractable Value) and HFT (High-Frequency Trading) dynamics on the Solana blockchain through Jupiter DEX quote monitoring.
The application continuously monitors Jupiter DEX quote latency and price drift to identify potential front-running opportunities and trading inefficiencies.
It operates by making concurrent API requests to Jupiter’s quote endpoint, tracking response times, price movements, and calculating statistical metrics to detect patterns that could indicate MEV opportunities.
-
🌀 Asynchronous Python Application – Built using
asynciofor concurrent quote fetching -
🧩 Modular Design – Separated concerns across multiple modules (tracking, analysis, config, utils)
-
📊 Data-Driven Analysis – Real-time statistical analysis of quote data and latency patterns
-
🖥️ CLI Interface – Command-line interface for configurable execution parameters
-
🐍 Python 3.11
-
🌐 aiohttp – Async HTTP client for fetching quotes
-
🌶️ Flask – Dashboard interface (optional)
-
📐 numpy – For numerical computation
-
⚙️ asyncio – For high-frequency concurrent requests
- 🎯 Purpose: Fetch and store Jupiter quotes
- 📦 Responsibilities:
- Managing HTTP sessions & requests
- Tracking latency and response times
- Storing quote data in a structured format
- 🌟 Key Features: Concurrent request handling, error tracking, performance monitoring
- 📈 Purpose: Analyze collected quote data
- 📊 Responsibilities:
- Calculate price drift
- Identify MEV opportunities
- Compute averages, percentiles, success rates
- 🧮 Thresholds:
- Drift:
0.01% - Latency advantage:
50ms
- Drift:
- ⚙️ Purpose: Centralized and validated settings
- 🧵 Defaults:
- Trading pair:
SOL → USDC - Swap amount:
1 SOL (1,000,000 lamports) - RPS:
5 requests/sec - Duration:
60 seconds - Workers:
10 concurrent - Slippage:
0.5%
- Trading pair:
- 🛠️ Purpose: Helper functions
- 🔢 Functions:
- Price drift calculations
- Number formatting
- Percent formatting
- 🚀 Initialization – Load config & setup HTTP session
- 🔁 Quote Fetching – Concurrent calls to Jupiter API
- 📥 Data Collection – Capture times, prices, metadata
- 📉 Real-Time Analysis – Run statistical processing
- 📤 Results Output – Export to CSV with formatting
The QuoteData structure is a container that stores detailed information about each individual quote received from the Jupiter API. Each quote record includes the following fields:
-
Timestamp: The exact time (in seconds) when the quote was recorded.
-
Request Time: The moment when the request to the Jupiter API was initiated.
-
Response Time: The moment when the response was received from the Jupiter API.
-
Latency: The total time it took (in seconds) between sending the request and receiving the response — a key metric for tracking speed and potential MEV timing advantages.
-
Output Amount: The amount of the output token (e.g., USDC) that would be received from the trade at the quoted rate.
-
Price Impact Percentage: A numerical value indicating how much the quote affects the market price — useful for understanding slippage and trade efficiency.
-
Route Plan: A list of routes (with metadata) that Jupiter uses to execute the swap. This might include details like the DEXs involved or token paths taken.
-
Success: A Boolean flag (
TrueorFalse) indicating whether the quote request was successful. -
Error (optional): If the quote failed, this field contains a description of the error for debugging or logging purposes.
- Endpoint:
https://quote-api.jup.ag/v6/quote - 🔍 Purpose: Real-time Solana DEX price quotes
- 📊 Rate Limiting: Configurable RPS and timeout control
- 🔁 Error Handling: Retry with exponential backoff
-
💰 Input Token:
SOL(So11111111111111111111111111111111111112) -
💵 Output Token:
USDC(EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v) -
🧠 Customizable: Supports all SPL token pairs
- This project is under the MIT LICENSE