Crypto Arbitrage 🔄
Real-time cryptocurrency arbitrage scanner and executor.
Detect price discrepancies across multiple exchanges, calculate profitable opportunities after fees, and execute arbitrage trades automatically.
🎯 What It Solves
Crypto traders miss opportunities because:
- - ❌ Can't monitor multiple exchanges simultaneously
- ❌ Manual calculation is too slow
- ❌ Fees eat into profits unexpectedly
- ❌ Withdrawal times kill opportunities
- ❌ No systematic approach to arbitrage
- ❌ Missing triangular arbitrage opportunities
Crypto Arbitrage provides:
- - ✅ Real-time multi-exchange price monitoring
- ✅ Instant profit calculation (including fees)
- ✅ Withdrawal time awareness
- ✅ Auto-execution for fast opportunities
- ✅ Triangular arbitrage detection
- ✅ Risk-adjusted opportunity scoring
✨ Features
📊 Multi-Exchange Scanning
- - Support for 20+ exchanges (Binance, Coinbase, Kraken, OKX, Bybit, etc.)
- Real-time price feeds via WebSocket
- Order book depth analysis
- Liquidity assessment
- Historical spread tracking
💰 Opportunity Detection
- - Spatial arbitrage (same asset, different exchanges)
- Triangular arbitrage (3+ pairs on same exchange)
- Cross-border arbitrage (USD vs USDT vs other stablecoins)
- Futures-spot basis arbitrage
- Funding rate arbitrage
🧮 Profit Calculation
- - Real-time fee calculation (maker/taker)
- Withdrawal fee inclusion
- Network gas fee estimation
- Slippage estimation
- Net profit after all costs
- ROI and annualized return
⚡ Auto-Execution
- - One-click arbitrage execution
- Configurable auto-execute thresholds
- Smart order routing
- Partial fill handling
- Failed trade recovery
- Position reconciliation
📈 Opportunity Scoring
- - Risk-adjusted scores (0-100)
- Execution speed requirements
- Liquidity scores
- Exchange reliability ratings
- Historical success rate
🔔 Smart Alerts
- - Price threshold alerts
- Spread alerts (absolute and percentage)
- ROI threshold alerts
- Liquidity alerts
- Exchange status changes
📊 Analytics & Reporting
- - Historical opportunity tracking
- Success/failure analysis
- Profit attribution by strategy
- Exchange performance comparison
- Tax-ready trade reports
📦 Installation
CODEBLOCK0
🚀 Quick Start
1. Initialize Arbitrage Scanner
CODEBLOCK1
2. Add Exchange Credentials
CODEBLOCK2
3. Start Scanning
CODEBLOCK3
4. Get Current Opportunities
CODEBLOCK4
5. Execute Arbitrage
CODEBLOCK5
6. Configure Auto-Execute
CODEBLOCK6
7. Get Triangular Arbitrage
CODEBLOCK7
8. Get Analytics
CODEBLOCK8
💡 Advanced Usage
Funding Rate Arbitrage
CODEBLOCK9
Cross-Border Arbitrage
CODEBLOCK10
Historical Analysis
CODEBLOCK11
Risk Management
CODEBLOCK12
Withdrawal Planning
CODEBLOCK13
🔧 Configuration
| Option | Type | Default | Description |
|---|
| INLINECODE0 | string | required | API key for scanner |
| INLINECODE1 |
array | [] | List of exchanges to scan |
|
minProfit | number | 0.5 | Minimum profit % to consider |
|
maxCapital | number | 10000 | Max capital per trade |
|
scanInterval | number | 1000 | Scan interval in ms |
|
autoExecute | boolean | false | Enable auto-execution |
|
riskProfile | string | 'moderate' | Risk tolerance |
📊 API Methods
Scanner Control
- -
startScanning(options) - Start opportunity scanning - INLINECODE8 - Stop scanning
- INLINECODE9 - Pause temporarily
- INLINECODE10 - Resume scanning
Exchange Management
- -
addExchange(name, credentials) - Add exchange - INLINECODE12 - Remove exchange
- INLINECODE13 - Check exchange status
- INLINECODE14 - Test API connection
Opportunity Detection
- -
getOpportunities(options) - Get current opportunities - INLINECODE16 - Find triangular arb
- INLINECODE17 - Find funding rate arb
- INLINECODE18 - Find cross-border arb
Execution
- -
executeArbitrage(opportunityId, options) - Execute arb - INLINECODE20 - Setup auto-execute
- INLINECODE21 - Cancel pending order
- INLINECODE22 - Check execution status
Analytics
- -
getAnalytics(options) - Get performance analytics - INLINECODE24 - Historical data
- INLINECODE25 - Exchange comparison
- INLINECODE26 - Strategy comparison
Risk Management
- -
setRiskLimits(limits) - Set risk limits - INLINECODE28 - Current exposure
- INLINECODE29 - Today's P&L
- INLINECODE30 - Max drawdown
Withdrawal Planning
- -
planWithdrawals(options) - Plan optimal withdrawal - INLINECODE32 - Get withdrawal fees
- INLINECODE33 - Get withdrawal times
- INLINECODE34 - Estimate gas/network fees
📁 File Structure
CODEBLOCK14
💰 Pricing
| Tier | Price | Features |
|---|
| Basic | $59 | Multi-exchange scanning, opportunity detection, manual execution, analytics |
| Pro |
$119 | + Auto-execution, triangular arbitrage, funding rate arb, advanced risk management |
⚠️ Risk Disclaimer
Arbitrage trading involves risks:
- - Exchange API failures
- Withdrawal delays
- Price slippage
- Network congestion
- Exchange insolvency risk
- Regulatory risks
This tool does not guarantee profits. Past performance does not indicate future results. Only trade with capital you can afford to lose.
📝 Changelog
v1.0.0 (2026-03-19)
- - Initial release
- Multi-exchange scanning (20+ exchanges)
- Spatial arbitrage detection
- Triangular arbitrage detection
- Funding rate arbitrage
- Real-time profit calculation
- Auto-execution engine
- Risk management
- Analytics and reporting
📄 License
MIT License - See LICENSE file for details.
🙏 Support
- - GitHub: https://github.com/openclaw/skills/crypto-arbitrage
- Discord: OpenClaw Community
- Email: support@openclaw.ai
Built with ❤️ by OpenClaw Agent - Your Crypto Arbitrage Scanner
加密货币套利 🔄
实时加密货币套利扫描与执行器。
检测多个交易所之间的价格差异,计算扣除费用后的盈利机会,并自动执行套利交易。
🎯 解决的问题
加密货币交易者错失机会的原因:
- - ❌ 无法同时监控多个交易所
- ❌ 手动计算速度太慢
- ❌ 费用意外侵蚀利润
- ❌ 提现时间导致机会流失
- ❌ 缺乏系统化的套利方法
- ❌ 遗漏三角套利机会
加密货币套利提供:
- - ✅ 实时多交易所价格监控
- ✅ 即时利润计算(含费用)
- ✅ 提现时间感知
- ✅ 快速机会自动执行
- ✅ 三角套利检测
- ✅ 风险调整机会评分
✨ 功能特性
📊 多交易所扫描
- - 支持20+交易所(币安、Coinbase、Kraken、OKX、Bybit等)
- 通过WebSocket实时价格推送
- 订单簿深度分析
- 流动性评估
- 历史价差追踪
💰 机会检测
- - 空间套利(同一资产,不同交易所)
- 三角套利(同一交易所3个及以上交易对)
- 跨境套利(USD vs USDT vs 其他稳定币)
- 期货-现货基差套利
- 资金费率套利
🧮 利润计算
- - 实时费用计算(挂单/吃单)
- 提现费用计入
- 网络Gas费估算
- 滑点估算
- 扣除所有成本后的净利润
- ROI和年化收益率
⚡ 自动执行
- - 一键套利执行
- 可配置的自动执行阈值
- 智能订单路由
- 部分成交处理
- 失败交易恢复
- 持仓对账
📈 机会评分
- - 风险调整评分(0-100)
- 执行速度要求
- 流动性评分
- 交易所可靠性评级
- 历史成功率
🔔 智能提醒
- - 价格阈值提醒
- 价差提醒(绝对值和百分比)
- ROI阈值提醒
- 流动性提醒
- 交易所状态变更
📊 分析与报告
- - 历史机会追踪
- 成功/失败分析
- 按策略的利润归因
- 交易所表现对比
- 税务就绪的交易报告
📦 安装
bash
clawhub install crypto-arbitrage
🚀 快速开始
1. 初始化套利扫描器
javascript
const { CryptoArbitrage } = require(crypto-arbitrage);
const scanner = new CryptoArbitrage({
apiKey: your-api-key,
exchanges: [binance, coinbase, kraken],
minProfit: 0.5, // 最低0.5%利润
maxCapital: 10000 // 每笔交易最高1万美元
});
2. 添加交易所凭证
javascript
await scanner.addExchange(binance, {
apiKey: your-binance-key,
apiSecret: your-binance-secret,
sandbox: false
});
await scanner.addExchange(coinbase, {
apiKey: your-coinbase-key,
apiSecret: your-coinbase-secret
});
await scanner.addExchange(kraken, {
apiKey: your-kraken-key,
apiSecret: your-kraken-secret
});
3. 开始扫描
javascript
await scanner.startScanning({
pairs: [BTC/USDT, ETH/USDT, SOL/USDT],
interval: 1000 // 每秒扫描一次
});
// 监听机会
scanner.on(opportunity, (opp) => {
console.log(🎯 发现机会!, opp);
});
4. 获取当前机会
javascript
const opportunities = await scanner.getOpportunities({
minProfit: 0.5, // 最低0.5%
minLiquidity: 1000 // 最低1000美元流动性
});
console.log(opportunities);
// [
// {
// id: arb_001,
// type: spatial,
// symbol: BTC/USDT,
// buyExchange: coinbase,
// sellExchange: binance,
// buyPrice: 67450,
// sellPrice: 67850,
// spread: 400,
// spreadPercent: 0.59,
// fees: {
// buyFee: 33.73,
// sellFee: 33.93,
// withdrawalFee: 5,
// totalFees: 72.66
// },
// netProfit: 327.34,
// netProfitPercent: 0.48,
// liquidity: 50000,
// executionTime: < 30s,
// riskScore: 85,
// recommendation: EXECUTE
// }
// ]
5. 执行套利
javascript
// 手动执行
const result = await scanner.executeArbitrage(opportunityId, {
amount: 10000, // 交易1万美元
dryRun: false // 设为true可预览
});
console.log(result);
// {
// executed: true,
// trades: [
// {
// exchange: coinbase,
// side: BUY,
// symbol: BTC/USDT,
// amount: 0.1482,
// price: 67450,
// value: 9996,
// fee: 9.996
// },
// {
// exchange: binance,
// side: SELL,
// symbol: BTC/USDT,
// amount: 0.1482,
// price: 67850,
// value: 10055,
// fee: 10.055
// }
// ],
// grossProfit: 59,
// totalFees: 25.05,
// netProfit: 33.95,
// netProfitPercent: 0.34,
// executionTime: 2.3s,
// status: COMPLETE
// }
6. 配置自动执行
javascript
await scanner.configureAutoExecute({
enabled: true,
minProfit: 1.0, // 利润超过1%时自动执行
maxCapital: 5000, // 每笔自动交易最高5000美元
maxDailyTrades: 20, // 每天最多20笔交易
excludedExchanges: [], // 不在这些交易所交易
cooldown: 5000 // 交易间隔5秒
});
7. 获取三角套利
javascript
const triangular = await scanner.findTriangularArbitrage({
exchange: binance,
baseAsset: USDT,
minProfit: 0.3
});
console.log(triangular);
// [
// {
// type: triangular,
// exchange: binance,
// path: [USDT, BTC, ETH, USDT],
// trades: [
// { pair: BTC/USDT, side: BUY },
// { pair: ETH/BTC, side: BUY },
// { pair: ETH/USDT, side: SELL }
// ],
// netProfit: 0.42,
// netProfitPercent: 0.42,
// executionTime: < 5s,
// riskScore: 92
// }
// ]
8. 获取分析数据
javascript
const analytics = await scanner.getAnalytics({
period: 7d
});
console.log(analytics);
// {
// period: 7d,
// opportunitiesFound: 156,
// opportunitiesExecuted: 42,
// successRate: 0.95,
// totalProfit: 1250,
// averageProfit: 29.76,
// bestTrade: 185,
// worstTrade: -12,
// byExchange: {
// binance: { trades: 20, profit: 650 },
// coinbase: { trades: 15, profit: 420 },
// kraken: { trades: 7, profit: 180 }
// },
// byStrategy: {
// spatial: { trades: 35, profit: 980 },
// triangular: { trades: 7, profit: 270 }
// }
// }
💡 高级用法
资金费率套利
javascript
const funding = await scanner.findFundingRateArbitrage({
minFundingRate: 0.01, // 年化1%
exchanges: [binance, bybit, okx]
});
// 做多现货,做空永续合约以收取资金费
跨境套利
javascript