70d43fefe0
New module: strategies/funding_arb.py
- get_funding_rates(): fetches predicted funding from Hyperliquid
Uses metaAndAssetCtxs (primary) + predictedFundings (fallback)
- funding_arb_signal(): generates entry/exit signals
Entry: |annual_rate| > threshold (3% testnet, 5% mainnet)
Exit: rate drops below 2% or flips sign
- 30s cache to avoid rate-limiting
Live node:
- Replaced proxy-based funding (20-period return) with real API
- Calls get_funding_rates(use_testnet=True) every compute_signals()
- Lowered threshold to 3% APR for testnet (lower liquidity)
Paper trader:
- Replaced manual funding calc with unified funding_arb_signal()
- Proper entry/exit logic with position tracking
- 5% APR threshold for mainnet data
Current rates: BTC +0.87% APR, ETH -0.82% APR
(Arb fires when rates exceed threshold during volatility)