solana-funding-arb
Solana perpetual DEX funding rate arbitrage - scanner and auto-trader. Compares funding rates across Drift and Flash Trade to find and execute cross-DEX arbitrage opportunities. Use when analyzing Solana perp funding rates, finding funding arbitrage, setting up delta-neutral strategies, or running automated funding collection. Includes Monte Carlo simulation, backtesting, and full auto-trading capabilities.
Install
mkdir -p .claude/skills/solana-funding-arb && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2176" && unzip -o skill.zip -d .claude/skills/solana-funding-arb && rm skill.zipInstalls to .claude/skills/solana-funding-arb
About this skill
Solana Funding Rate Arbitrage (v2.0)
Automated funding rate arbitrage bot for Solana perpetual DEXes.
🔥 What's New in v2.0
- Auto-Trading: Fully automated position management
- Multi-DEX Support: Drift Protocol + Flash Trade
- Position Manager: Track PnL and funding collected
- Risk Management: Stop-loss, max DD, auto-rebalancing
- Cron Integration: Scheduled rate checks
Supported DEXes
| DEX | Markets | Trading | Data Source |
|---|---|---|---|
| Drift Protocol | 64 | ✅ Full | Direct API |
| Flash Trade | 19 | 🔶 DRY_RUN | CoinGecko |
Strategy Options
| Strategy | Leverage | Win Rate | APY | Max Drawdown |
|---|---|---|---|---|
| Ultra Safe | 1x | 96% | 126% | 2% |
| Conservative | 1.5x | 89% | 203% | 4% |
| Moderate | 2.5x | 85% | 411% | 9% |
Quick Start
cd scripts && npm install
# 1. Scan funding rates (no trading)
npm run trade:scan
# 2. Check position status
npm run trade:status
# 3. Run in DRY_RUN mode (simulated)
npm run trade:dry
# 4. Run live trading (requires wallet)
npm run trade
# Other commands
npm run scan # Basic rate scanner
npm run dashboard # Web dashboard (:3456)
npm run monte-carlo # Risk simulations
Configuration
Config file: ~/.secrets/funding-arb-config.json
{
"strategy": "ultra_safe",
"max_position_pct": 50,
"min_spread": 0.5,
"max_dd_pct": 2,
"auto_execute": true,
"dry_run": true,
"leverage": 1,
"check_interval_hours": 4,
"min_apy_threshold": 100,
"max_position_usd": 100,
"notification": {
"telegram": true,
"on_open": true,
"on_close": true,
"on_funding": true
},
"risk": {
"max_positions": 2,
"stop_loss_pct": 2,
"take_profit_pct": null,
"auto_rebalance": true,
"rebalance_threshold": 0.3
}
}
Environment Variables
Create .env in scripts directory or ~/.secrets/.env:
# Required for live trading
SOLANA_PRIVATE_KEY=[1,2,3,...] # Or use wallet file
SOLANA_WALLET_PATH=/path/to/wallet.json
# Optional
SOLANA_RPC_URL=https://mainnet.helius-rpc.com/?api-key=YOUR_KEY
DEBUG=true # Verbose logging
Cron Setup
Run every 4 hours:
# Add to crontab -e
0 */4 * * * ~/clawd/skills/solana-funding-arb/scripts/cron-runner.sh
How It Works
- Scan: Compare funding rates on Drift vs Flash Trade
- Identify: Find pairs where one is paying and other is receiving
- Execute:
- Go LONG on exchange with negative rate (receive funding)
- Go SHORT on exchange with positive rate (receive funding)
- Collect: Delta-neutral = collect funding from both sides
- Rebalance: Close when spread reverses or DD exceeded
Example Trade
SOL Funding Rates:
- Drift: -500% APY (longs receive)
- Flash: +800% APY (shorts receive)
- Spread: 1300% APY
Action:
→ LONG $50 SOL on Drift (receive 500% APY)
→ SHORT $50 SOL on Flash (receive 800% APY)
→ Net: Delta-neutral, collecting ~1300% APY in funding
Files
scripts/
├── src/trading/
│ ├── auto-trader.ts # Main trading logic
│ ├── drift-client.ts # Drift Protocol integration
│ ├── flash-client.ts # Flash Trade integration
│ └── position-manager.ts # Position tracking
├── cron-runner.sh # Cron wrapper script
└── ...
~/.clawd/funding-arb/
├── positions.json # Current positions
├── history.json # Trade history
├── trader-state.json # Bot state
└── logs/ # Cron logs
Risks
⚠️ Smart Contract Risk: DEX bugs, hacks ⚠️ Rate Reversal: 15-18% daily probability ⚠️ Execution Slippage: 0.2-0.4% ⚠️ Liquidation: Only with leverage >1x
Yield Comparison
| Platform | APY | vs Ultra Safe |
|---|---|---|
| Ultra Safe (1x) | 126% | — |
| US Bank (FDIC) | 4.5% | 28x less |
| Aave V3 | 2.5% | 50x less |
| Marginfi | 8.5% | 15x less |
Testing
- Start with
dry_run: true(default) - Run
npm run trade:scanto verify opportunities - Run
npm run trade:dryto test execution flow - When ready, set
dry_run: falseandmax_position_usd: 10 - Monitor logs at
~/.clawd/funding-arb/logs/
References
More by openclaw
View all skills by openclaw →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversSolana Agent Kit: Easily deploy tokens, mint NFTs, and manage DeFi & cross-chain tasks with Solana integration in chat i
Access multi-chain data across 130+ networks with Tatum Blockchain—NFT metadata, wallet portfolios, token verification,
Boost your AI code assistant with Context7: inject real-time API documentation from OpenAPI specification sources into y
Use Chrome DevTools for web site test speed, debugging, and performance analysis. The essential chrome developer tools f
Extend your developer tools with GitHub MCP Server for advanced automation, supporting GitHub Student and student packag
Optimize your codebase for AI with Repomix—transform, compress, and secure repos for easier analysis with modern AI tool
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.