Track WETH/USDC price differences between Uniswap V4 (Ethereum) and Aerodrome (Base) to spot arbitrage opportunities in real-time.
Argus is like a price comparison app for crypto traders. It watches the ETH/USDC price on two different exchanges:
- Uniswap V4 on Ethereum (expensive but liquid)
 - Aerodrome on Base (cheap but newer)
 
When prices differ, Argus calculates if you can make money by buying on the cheaper exchange and selling on the expensive one - even after paying transaction fees (gas).
Example: If ETH is $3,000 on Uniswap but $3,050 on Aerodrome, and gas costs total $30, you'd make $20 profit per ETH traded!
Create a .env file with these required settings:
# Required - Your RPC endpoints
ETHEREUM_RPC_URL=https://eth.llamarpc.com
BASE_RPC_URL=https://base.llamarpc.com
# Optional - Server configuration
SERVER_PORT=8080                    # Port to run the API server (default: 8080)
CEX_PROVIDER=coinbase               # CEX for reference price: coinbase, kraken, or binance (default: coinbase)| Variable | Required | Description | Example | 
|---|---|---|---|
ETHEREUM_RPC_URL | 
✅ Yes | Ethereum Mainnet RPC endpoint | https://eth.llamarpc.com | 
BASE_RPC_URL | 
✅ Yes | Base Mainnet RPC endpoint | https://base.llamarpc.com | 
SERVER_PORT | 
No | API server port | 8080 (default) | 
CEX_PROVIDER | 
No | Centralized exchange for reference price | coinbase (default), kraken, binance | 
Note: No API keys are required! All endpoints use public APIs and RPC endpoints.
# Build the Docker image
docker build -t argus:latest .
# Run the container
docker run -p 8080:8080 \
  -e ETHEREUM_RPC_URL=https://eth.llamarpc.com \
  -e BASE_RPC_URL=https://base.llamarpc.com \
  argus:latest
# Test the API (in another terminal)
curl "http://localhost:8080/api/v1/arbitrage-opportunity?trade_size_eth=1"# Clone and run
git clone https://github.com/JumpiiX/argus
cd argus
cargo runThat's it! The service is now running at http://localhost:8080
GET /api/v1/arbitrage-opportunity?trade_size_eth=10
What you get back:
{
  "timestamp_utc": "2024-01-01T10:00:00Z",
  "trade_size_eth": 10.0,
  "reference_cex_price_usd": 3100.50,
  "uniswap_v4_details": {
    "effective_price_usd": 3098.25,
    "price_impact_percent": -0.072,
    "estimated_gas_cost_usd": 40.15
  },
  "aerodrome_details": {
    "effective_price_usd": 3105.75,
    "price_impact_percent": -0.150,
    "estimated_gas_cost_usd": 0.85
  },
  "arbitrage_summary": {
    "potential_profit_usd": 75.00,
    "total_gas_cost_usd": 41.00,
    "net_profit_usd": 34.00,
    "recommended_action": "ARBITRAGE_DETECTED"
  }
}What this means:
effective_price_usd: The actual price you'd get for your trade sizeprice_impact_percent: How much your trade moves the marketestimated_gas_cost_usd: Cost to execute the swap on that chainnet_profit_usd: Your profit after all costs (if positive, there's an opportunity!)recommended_action: EitherARBITRAGE_DETECTEDorNO_ARBITRAGE
GET /health - Returns OK if service is running
- Gets Reference Price: Fetches ETH/USDC from Coinbase to know the "fair" market price
 - Checks Both DEXs:
- Asks Uniswap V4: "What's your ETH price?"
 - Asks Aerodrome: "What's YOUR ETH price?"
 
 - Calculates Real Costs:
- Ethereum gas: Like surge pricing during rush hour (can be $20-100 per transaction)
 - Base gas: Cheaper local fee + expensive Ethereum storage fee
 
 - Does the Math:
Profit = Price Difference × Amount Costs = Ethereum Gas + Base Gas Net = Profit - Costs If Net > 0: " ARBITRAGE OPPORTUNITY!" If Net ≤ 0: " Not profitable" 
# Format code
cargo fmt
# Lint (strict mode with pedantic checks)
cargo clippy --all-targets --all-features --workspace -- -W clippy::pedantic -D warnings
# Run tests
cargo test
# Build optimized
cargo build --release- Runtime: Tokio (async Rust) - Handles multiple operations at once
 - Web Framework: Rocket - Simple, type-safe API endpoints
 - Blockchains: Ethereum (expensive, established) + Base L2 (cheap, fast)
 - DEXs:
- Uniswap V4: Advanced AMM with concentrated liquidity
 - Aerodrome: Simple constant-product AMM (x*y=k)
 
 - Price Feeds: Coinbase, Kraken, Binance APIs for reference prices
 
argus/
├── src/
│   ├── main.rs          # Entry point
│   ├── service.rs       # Core arbitrage logic
│   ├── api/             # REST endpoints
│   ├── rpc/             # Chain interactions
│   ├── dex/             # DEX integrations
│   ├── cex/             # CEX price feeds
│   └── analytics/       # Profit calculations
└── .env.example         # Config template
MIT