# Send Solana Funding Arb Cn to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "solana-funding-arb-cn",
    "name": "Solana Funding Arb Cn",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/guohongbin-git/solana-funding-arb-cn",
    "canonicalUrl": "https://clawhub.ai/guohongbin-git/solana-funding-arb-cn",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/solana-funding-arb-cn",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=solana-funding-arb-cn",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "USER_GUIDE.md",
      "_meta.json",
      "references/api.md",
      "references/setup.md",
      "references/strategies.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/solana-funding-arb-cn"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/solana-funding-arb-cn",
    "downloadUrl": "https://openagent3.xyz/downloads/solana-funding-arb-cn",
    "agentUrl": "https://openagent3.xyz/skills/solana-funding-arb-cn/agent",
    "manifestUrl": "https://openagent3.xyz/skills/solana-funding-arb-cn/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/solana-funding-arb-cn/agent.md"
  }
}
```
## Documentation

### 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

DEXMarketsTradingData SourceDrift Protocol64✅ FullDirect APIFlash Trade19🔶 DRY_RUNCoinGecko

### Strategy Options

StrategyLeverageWin RateAPYMax DrawdownUltra Safe1x96%126%2%Conservative1.5x89%203%4%Moderate2.5x85%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

PlatformAPYvs Ultra SafeUltra Safe (1x)126%—US Bank (FDIC)4.5%28x lessAave V32.5%50x lessMarginfi8.5%15x less

### Testing

Start with dry_run: true (default)
Run npm run trade:scan to verify opportunities
Run npm run trade:dry to test execution flow
When ready, set dry_run: false and max_position_usd: 10
Monitor logs at ~/.clawd/funding-arb/logs/

### References

Drift Protocol Docs
Flash Trade
API Reference
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: guohongbin-git
- Version: 1.0.1
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/solana-funding-arb-cn)
- [Send to Agent page](https://openagent3.xyz/skills/solana-funding-arb-cn/agent)
- [JSON manifest](https://openagent3.xyz/skills/solana-funding-arb-cn/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/solana-funding-arb-cn/agent.md)
- [Download page](https://openagent3.xyz/downloads/solana-funding-arb-cn)