solana-funding-arbSolana 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 via ClawdBot CLI:
clawdbot install Zedit42/solana-funding-arbAutomated funding rate arbitrage bot for Solana perpetual DEXes.
| DEX | Markets | Trading | Data Source |
|-----|---------|---------|-------------|
| Drift Protocol | 64 | ✅ Full | Direct API |
| Flash Trade | 19 | 🔶 DRY_RUN | CoinGecko |
| 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% |
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
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
}
}
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
Run every 4 hours:
# Add to crontab -e
0 */4 * * * ~/clawd/skills/solana-funding-arb/scripts/cron-runner.sh
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
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
⚠️ Smart Contract Risk: DEX bugs, hacks
⚠️ Rate Reversal: 15-18% daily probability
⚠️ Execution Slippage: 0.2-0.4%
⚠️ Liquidation: Only with leverage >1x
| 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 |
dry_run: true (default)npm run trade:scan to verify opportunitiesnpm run trade:dry to test execution flowdry_run: false and max_position_usd: 10~/.clawd/funding-arb/logs/Generated Mar 1, 2026
Retail investors can deploy this skill to automatically scan and execute delta-neutral funding arbitrage between Drift and Flash Trade on Solana. It allows users to earn high APY (126-411%) with minimal manual intervention by setting strategies like Ultra Safe and using cron jobs for scheduled checks. This is ideal for those seeking passive income from DeFi without active trading management.
Crypto funds and institutional traders can use this skill to incorporate funding rate arbitrage into their portfolios, leveraging its Monte Carlo simulations and backtesting for risk assessment. The auto-trading and stop-loss features help manage drawdowns while capturing spreads across multiple DEXes, enhancing overall yield in a controlled manner.
Developers and students in fintech can utilize this skill to learn about funding rates, arbitrage mechanics, and delta-neutral strategies on Solana. The dry-run mode and simulation capabilities provide a safe environment to experiment with real-time data without financial risk, making it a practical educational resource.
Algorithmic trading firms can integrate this skill into their systems to exploit short-term funding rate discrepancies between Drift and Flash Trade. With auto-execution, multi-DEX support, and configurable check intervals, it enables high-frequency arbitrage opportunities, optimizing returns through rapid position adjustments.
Individual crypto enthusiasts looking for additional income can set up this skill to run automatically via cron jobs, collecting funding from arbitrage positions. The conservative strategy options and notification features (e.g., Telegram alerts) make it accessible for users with moderate technical skills to earn yields exceeding traditional banking returns.
Offer this skill as a subscription-based service where users pay a monthly fee for access to the bot, regular updates, and premium features like advanced risk analytics or priority support. Revenue can be generated through tiered plans based on trading volume or strategy complexity, targeting retail and small institutional clients.
License the skill to cryptocurrency exchanges, DeFi platforms, or trading firms as a white-label product. They can integrate it into their offerings to provide funding arbitrage services to their users, with revenue coming from licensing fees or a revenue-sharing model based on the profits generated by the bot.
Provide consulting services to help clients set up and customize the skill for their specific needs, such as integrating with additional DEXes or adjusting risk parameters. Revenue is earned through hourly rates or project-based fees, catering to businesses seeking tailored arbitrage solutions.
💬 Integration Tip
Start with dry-run mode and small max_position_usd to test execution flow, then gradually increase exposure while monitoring logs and using the dashboard for real-time insights.
Connect Claude to Clawdbot instantly and keep it connected 24/7. Run after setup to link your subscription, then auto-refreshes tokens forever.
ERC-8004 Trustless Agents - Register, discover, and build reputation for AI agents on Ethereum. Use when registering agents on-chain, querying agent registries, giving/receiving reputation feedback, or interacting with the AI agent trust layer.
Autonomous crypto trading on Base via Bankr. Use for trading tokens, monitoring launches, executing strategies, or managing a trading portfolio. Triggers on "trade", "buy", "sell", "launch", "snipe", "profit", "PnL", "portfolio balance", or any crypto trading task on Base.
Deploy ERC20 tokens on Base using Clanker SDK. Create tokens with built-in Uniswap V4 liquidity pools. Supports Base mainnet and Sepolia testnet. Requires PRIVATE_KEY in config.
Query DeFi portfolio data across 50+ chains via Zapper's GraphQL API. Use when the user wants to check wallet balances, DeFi positions, NFT holdings, token prices, or transaction history. Supports Base, Ethereum, Polygon, Arbitrum, Optimism, and more. Requires ZAPPER_API_KEY.
Interact with Solana blockchain via Helius APIs. Create/manage wallets, check balances (SOL + tokens), send transactions, swap tokens via Jupiter, and monitor addresses. Use for any Solana blockchain operation, crypto wallet management, token transfers, DeFi swaps, or portfolio tracking.