Finding Arbitrage Opportunities
Overview
Detect and analyze arbitrage opportunities across cryptocurrency exchanges and DeFi protocols. Aggregates prices from CEX and DEX sources, calculates net profit after fees, and identifies direct, triangular, and cross-chain arbitrage paths.
Prerequisites
- Python 3.9+ with
httpx, rich, and networkx packages
- Internet access for API calls (no API keys required for basic use)
- Optional: Exchange API keys for real-time order book access
- Understanding of arbitrage concepts and trading fees
Instructions
Quick spread scan on a specific pair:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py scan ETH USDC
Shows current prices per exchange, spread %, estimated profit after fees, and recommended action.
Multi-exchange comparison across specific exchanges:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py scan ETH USDC \
--exchanges binance,coinbase,kraken,kucoin,okx
DEX price comparison across decentralized exchanges:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py scan ETH USDC --dex-only
Compares Uniswap V3, SushiSwap, Curve, Balancer with gas cost estimates.
Triangular arbitrage discovery within a single exchange:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py triangular binance --min-profit 0.5
Cross-chain opportunities across different blockchains:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py cross-chain USDC \
--chains ethereum,polygon,arbitrum
Real-time monitoring with threshold alerts:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py monitor ETH USDC \
--threshold 0.5 --interval 5
Export opportunities for bot integration:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py scan ETH USDC --output json > opportunities.json
Output
- Quick mode (default): Best opportunity with profit estimate, buy/sell recommendation, risk level
- Detailed mode (
--detailed): All exchange prices, fee breakdown, slippage estimates, historical spread context
- Monitor mode: Real-time updates with threshold alerts and trend indicators
See ${CLAUDE_SKILL_DIR}/references/implementation.md for exchange fee tables and output format examples.
Error Handling
| Error |
Cause |
Fix |
| Rate limited |
Too many API requests |
Reduce polling frequency or add API key |
| Stale prices |
Data older than 10s |
Flagged with warning; retry |
| No spread |
Efficient market pricing |
Normal condition; try different pairs |
| Insufficient liquidity |
Trade exceeds order book depth |
Reduce trade size |
Examples
Quick ETH/USDC spread scan - Find best buy/sell across all CEX exchanges:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py scan ETH USDC
Sample detection output:
ARB OPPORTUNITY: ETH/USDC
Buy: Binance @ $3,198.50 | Sell: Coinbase @ $3,214.20
Spread: 0.49% | Net Profit (after fees): 0.29% ($9.27 per ETH)
Risk: LOW | Confidence: HIGH | Window: ~30s
Triangular arb on Binance - Discover circular paths with minimum 0.5% net profit:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py triangular binance --min-profit 0.5
Cross-chain USDC opportunities - Compare stablecoin prices across L1/L2 chains:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py cross-chain USDC --chains ethereum,polygon,arbitrum
Calculate exact profit - Detailed fee breakdown for a specific trade:
python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py calc \
--buy-exchange binance --sell-exchange coinbase --pair ETH/USDC --amount 10 # 10 = trade size in ETH
Resources
- CoinGecko API - Free price data
- CCXT Library - Unified exchange API
- Uniswap Subgraph - DEX data
${CLAUDE_SKILL_DIR}/references/implementation.md - Exchange fee tables, configuration, advanced arbitrage types, disclaimer
1---
2name: finding-arbitrage-opportunities
3description: |
4 Detect profitable arbitrage opportunities across CEX, DEX, and cross-chain markets in real-time.
5 Use when scanning for price spreads, finding arbitrage paths, comparing exchange prices, or analyzing triangular arbitrage opportunities.
6 Trigger with phrases like "find arbitrage", "scan for arb", "price spread", "exchange arbitrage", "triangular arb", "DEX price difference", or "cross-exchange opportunity".
7
8allowed-tools: Read, Write, Edit, Grep, Glob, Bash(crypto:arbitrage-*)
9version: 1.0.0
10author: Jeremy Longshore <jeremy@intentsolutions.io>
11license: MIT
12compatible-with: claude-code, codex, openclaw
13metadata:
14 source: https://skillmd.com/skills/micsapp/finding-arbitrage-opportunities
15---
16
17# Finding Arbitrage Opportunities
18
19## Overview
20
21Detect and analyze arbitrage opportunities across cryptocurrency exchanges and DeFi protocols. Aggregates prices from CEX and DEX sources, calculates net profit after fees, and identifies direct, triangular, and cross-chain arbitrage paths.
22
23## Prerequisites
24
25- Python 3.9+ with `httpx`, `rich`, and `networkx` packages
26- Internet access for API calls (no API keys required for basic use)
27- Optional: Exchange API keys for real-time order book access
28- Understanding of arbitrage concepts and trading fees
29
30## Instructions
31
321. **Quick spread scan** on a specific pair:
33 ```bash
34 python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py scan ETH USDC
35 ```
36 Shows current prices per exchange, spread %, estimated profit after fees, and recommended action.
37
382. **Multi-exchange comparison** across specific exchanges:
39 ```bash
40 python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py scan ETH USDC \
41 --exchanges binance,coinbase,kraken,kucoin,okx
42 ```
43
443. **DEX price comparison** across decentralized exchanges:
45 ```bash
46 python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py scan ETH USDC --dex-only
47 ```
48 Compares Uniswap V3, SushiSwap, Curve, Balancer with gas cost estimates.
49
504. **Triangular arbitrage discovery** within a single exchange:
51 ```bash
52 python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py triangular binance --min-profit 0.5
53 ```
54
555. **Cross-chain opportunities** across different blockchains:
56 ```bash
57 python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py cross-chain USDC \
58 --chains ethereum,polygon,arbitrum
59 ```
60
616. **Real-time monitoring** with threshold alerts:
62 ```bash
63 python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py monitor ETH USDC \
64 --threshold 0.5 --interval 5
65 ```
66
677. **Export opportunities** for bot integration:
68 ```bash
69 python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py scan ETH USDC --output json > opportunities.json
70 ```
71
72## Output
73
74- **Quick mode** (default): Best opportunity with profit estimate, buy/sell recommendation, risk level
75- **Detailed mode** (`--detailed`): All exchange prices, fee breakdown, slippage estimates, historical spread context
76- **Monitor mode**: Real-time updates with threshold alerts and trend indicators
77
78See `${CLAUDE_SKILL_DIR}/references/implementation.md` for exchange fee tables and output format examples.
79
80## Error Handling
81
82| Error | Cause | Fix |
83|-------|-------|-----|
84| Rate limited | Too many API requests | Reduce polling frequency or add API key |
85| Stale prices | Data older than 10s | Flagged with warning; retry |
86| No spread | Efficient market pricing | Normal condition; try different pairs |
87| Insufficient liquidity | Trade exceeds order book depth | Reduce trade size |
88
89## Examples
90
91**Quick ETH/USDC spread scan** - Find best buy/sell across all CEX exchanges:
92```bash
93python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py scan ETH USDC
94```
95
96Sample detection output:
97```
98 ARB OPPORTUNITY: ETH/USDC
99 Buy: Binance @ $3,198.50 | Sell: Coinbase @ $3,214.20
100 Spread: 0.49% | Net Profit (after fees): 0.29% ($9.27 per ETH)
101 Risk: LOW | Confidence: HIGH | Window: ~30s
102```
103
104**Triangular arb on Binance** - Discover circular paths with minimum 0.5% net profit:
105```bash
106python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py triangular binance --min-profit 0.5
107```
108
109**Cross-chain USDC opportunities** - Compare stablecoin prices across L1/L2 chains:
110```bash
111python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py cross-chain USDC --chains ethereum,polygon,arbitrum
112```
113
114**Calculate exact profit** - Detailed fee breakdown for a specific trade:
115```bash
116python ${CLAUDE_SKILL_DIR}/scripts/arb_finder.py calc \
117 --buy-exchange binance --sell-exchange coinbase --pair ETH/USDC --amount 10 # 10 = trade size in ETH
118```
119
120## Resources
121
122- [CoinGecko API](https://www.coingecko.com/en/api) - Free price data
123- [CCXT Library](https://github.com/ccxt/ccxt) - Unified exchange API
124- [Uniswap Subgraph](https://thegraph.com/hosted-service/subgraph/uniswap/uniswap-v3) - DEX data
125- `${CLAUDE_SKILL_DIR}/references/implementation.md` - Exchange fee tables, configuration, advanced arbitrage types, disclaimer