🔍 BITFINEX API V2 - CORRECT EARNINGS/YIELD ENDPOINTS TEST =========================================================== 🔑 Using API Key: 8c16179d... 🔑 Using API Secret: 49bdfa5f... 📊 TESTING LEDGERS ENDPOINT FOR EARNINGS DATA ============================================== 📡 Test 1: Get recent ledgers (all currencies) ---------------------------------------------- ❌ Error: HTTP 500 Response: ["error",10114,"nonce: small"]... 📡 Test 2: Get ledgers for different time periods -------------------------------------------------- 🕐 Testing period: 24h (from 2025-12-07 07:24:49) ❌ Error: HTTP 500 Response: ["error",10114,"nonce: small"]... 🕐 Testing period: 1_week (from 2025-12-01 07:24:49) ❌ Error: HTTP 500 Response: ["error",10114,"nonce: small"]... 🕐 Testing period: 1_month (from 2025-11-08 07:24:49) ❌ Error: HTTP 500 Response: ["error",10114,"nonce: small"]... 🕐 Testing period: 3_months (from 2025-09-09 07:24:49) ❌ Error: HTTP 500 Response: ["error",10114,"nonce: small"]... 📡 Test 3: Test currency-specific ledgers ------------------------------------------ 💱 Testing USD ledgers... ❌ Error: HTTP 500 Response: ["error",10114,"nonce: small"]... 💱 Testing EUR ledgers... ❌ Error: HTTP 500 Response: ["error",10114,"nonce: small"]... 💱 Testing BTC ledgers... ❌ Error: HTTP 500 Response: ["error",10114,"nonce: small"]... 💱 Testing ETH ledgers... ❌ Error: HTTP 500 Response: ["error",10114,"nonce: small"]... 🎯 CONCLUSIONS ============== • The /v2/auth/r/ledgers/hist endpoint is the correct endpoint for earnings data • Earnings can be identified by description containing 'funding', 'interest', 'margin', or 'payment' • Time-based filtering works with 'start' and 'end' parameters (milliseconds) • Currency-specific queries are available via /v2/auth/r/ledgers/{currency}/hist • Data is available up to 6 years old (as per Bitfinex documentation) • Rate limit: 90 requests per minute • Response format: [ID, CURRENCY, null, TIMESTAMP_MILLI, null, AMOUNT, BALANCE, null, DESCRIPTION] 📝 IMPLEMENTATION RECOMMENDATIONS ================================= 1. Use /v2/auth/r/ledgers/hist for comprehensive earnings data 2. Filter by description keywords: 'funding', 'interest', 'margin', 'payment' 3. Implement time-period specific queries: 24h, 1w, 1m, 3m, 6m, 12m 4. Cache results to respect rate limits (90 req/min) 5. Add to Telegram bot as /earnings command 6. Consider currency-specific queries for detailed breakdowns