# FundingRadar - Complete Technical Specification (llms-full.txt) Canonical Origin: https://funding.dovafy.com Schema Version: 1.0.0 ## 1. Product Summary FundingRadar is a deterministic (no-LLM) quantitative market data engine that aggregates live perpetual futures funding rates, mark/index prices, and single-sided open interest across 5 keyless global exchanges (Hyperliquid, dYdX v4, OKX, Bybit, Gate.io). It outputs fee-adjusted cross-exchange short/long arbitrage opportunities, break-even hours, entry price spreads, and OI-weighted crowding signals. ## 2. Deterministic Normalization & Math Formulas ### 2.1 Settlement Cycle Normalization Different exchanges settle funding every 1h (Hyperliquid, dYdX v4) or dynamically every 1h, 2h, 4h, or 8h (OKX, Bybit, Gate.io). Every contract is normalized via: - rate1h = fundingRate / fundingIntervalHours - rate8h = rate1h * 8 - aprPct = rate1h * 24 * 365 * 100 ### 2.2 Contract Multiplier Normalization To prevent 1000x price and basis distortion across exchanges: - Hyperliquid lowercase k-prefix contracts (e.g. kPEPE, kBONK, kSHIB, kLUNC) divide mark/oracle price by 1000 while keeping uppercase K tickers (KAS) untouched. - Bybit numeric prefix contracts (1000PEPEUSDT, 10000SATSUSDT, 1000000BABYDOGEUSDT) divide mark/index price by the exact numeric multiplier while keeping 1INCH untouched. - Known rebranded tickers map canonically (RNDR -> RENDER, MATIC -> POL). - Ticker Collision Guard: pairs whose normalized unit mark prices diverge by >50% (max/min > 1.5) are rejected to prevent pairing distinct tokens that happen to share a ticker. ### 2.3 Bilateral Taker Fee Drag & Break-Even Hours Default public standard-tier taker fees (overridable via customTakerFeeBps query param): - hyperliquid: 3.5 bps (0.035%) - dydx: 5.0 bps (0.050%) - okx: 5.0 bps (0.050%) - bybit: 5.5 bps (0.055%) - gate: 5.0 bps (0.050%) - roundTripFeePct = 2 * ((shortTakerFeeBps + longTakerFeeBps) / 100) # 4 legs: open + close on both venues - hourlySpreadPct = (short.rate1h - long.rate1h) * 100 - breakEvenHours = roundTripFeePct / hourlySpreadPct - annualizedFeeDragPct = roundTripFeePct * (365 / holdDays) # default holdDays = 30 - netAprPct = grossSpreadAprPct - annualizedFeeDragPct - entryPriceSpreadPct = ((short.unitMarkPrice - long.unitMarkPrice) / long.unitMarkPrice) * 100 ### 2.4 Crowding Classification (OI-Weighted APR) - NEUTRAL: -25% < oiWeightedAprPct < +25% - CROWDED_LONG: +25% <= oiWeightedAprPct < +80% - CROWDED_SHORT: -80% < oiWeightedAprPct <= -25% - EXTREME: |oiWeightedAprPct| >= 80% (paired with crowdingBias: LONG or SHORT) ## 3. Endpoints & Parameters ### GET https://funding.dovafy.com/v1/sample (Free, 15s edge cache) Returns live BTC, ETH, and SOL venue comparisons plus top 5 arbitrage opportunities without authentication. ### GET https://funding.dovafy.com/v1/funding/opportunities ($0.01 x402 / RapidAPI / Apify) Query parameters: - minApr (number, default 15, range -1000..10000): minimum 30d net APR% - minOiUsd (number, default 500000): minimum single-leg open interest in USD - holdDays (number, default 30, range 1..365): holding window for fee amortization - limit (integer, default 20, range 1..100): max rows returned - exchanges (optional comma list): hyperliquid,dydx,okx,bybit,gate - customTakerFeeBps (optional number, 0..100): uniform taker fee override in bps ### GET https://funding.dovafy.com/v1/funding/asset/{symbol} ($0.005 x402 / RapidAPI / Apify) Path parameter: symbol (accepts BTC, sol-usd, kPEPE, 1000PEPEUSDT, PEPE_USDT, BTC-USDT-SWAP). Query parameters: holdDays (default 30), customTakerFeeBps (optional). ### GET https://funding.dovafy.com/v1/funding/extremes ($0.005 x402 / RapidAPI / Apify) Query parameters: direction (all | positive | negative, default all), minOiUsd (default 500000), limit (default 20, max 100), exchanges (optional). ## 4. Payment & Authentication Rails 1. HTTP x402 v2 (Autonomous AI Agents & Pay-Per-Call): - Network: eip155:8453 (Base Mainnet) - Asset: Native USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) - PayTo: 0x1519E99078EBaB798ef52326b67E5b28603A20ec - Facilitator: https://facilitator.payai.network - Unpaid requests return HTTP 402 with Base64 PAYMENT-REQUIRED header (CORS exposed). Paid retries include PAYMENT-SIGNATURE header and receive PAYMENT-RESPONSE receipt. 2. RapidAPI Monthly Subscription: Free / $19 Pro / $49 Ultra monthly plans. 3. Apify Store Actor: Pay-per-run or monthly rental via FundingRadar Actor. 4. Thin MCP Server: `npx -y funding-radar-mcp` (tools: get_funding_sample, get_funding_opportunities, get_asset_funding, get_funding_extremes). ## 5. Resilience & Caching - Single-flight 15s memory cache coalesces concurrent requests per instance. - Per-exchange 6s timeout with Promise.allSettled allows 1-2 degraded venues without failing the response. - 10-minute stale-on-error fallback prevents transient total outages.