ChainStream currently supports Solana (
sol), Ethereum (eth), and BSC (bsc). Supported DEXes are Jupiter, Raydium, PumpFun, Moonshot, Candy (Solana), and KyberSwap (Ethereum/BSC). Some code examples below reference additional DEXes for conceptual illustration — check Supported Chains for the current coverage.Estimated Time: 45 minutes
Difficulty Level: ⭐⭐⭐ Intermediate
Difficulty Level: ⭐⭐⭐ Intermediate
Objective
Discover cross-DEX price difference arbitrage opportunities: Feature Checklist:- ✅ Get multi-DEX trading pair prices
- ✅ Calculate spread percentage
- ✅ Evaluate feasibility (considering Gas, slippage, depth)
- ✅ Risk alerts (MEV, front-running)
Arbitrage Principles
Cross-DEX Arbitrage
The same token may have price differences across different DEXes:Profit Formula
Net Profit = Spread Revenue - Gas Fees - Slippage Loss
- Gas fees for two transactions
- Buy/sell slippage
- Liquidity depth limits
- MEV front-running risk
Step 1: Get Trading Pairs
1.1 Install Dependencies
1.2 Configuration File
1.3 Get Price Data
Step 2: Calculate Spread
Step 3: Evaluate Feasibility
Risk Assessment
Risk Warning
Complete Code
Extension Suggestions
Flash Loan Integration
Use flash loans for zero-capital arbitrage
Multi-chain Scanning
Add eth / bsc KyberSwap quotes alongside Solana venues
Auto Execution
Integrate wallet for automatic trading (use caution)
Related Documentation
DeFi Monitoring Overview
Learn about DeFi monitoring dimensions
Price Alert Bot
Get started with real-time price monitoring

