- Fixed balance calculation: corrected precision factor for Drift scaledBalance (5.69 vs wrong 0,678.76) - Implemented multi-RPC failover system with 4 endpoints (Helius, Solana official, Alchemy, Ankr) - Updated automation page with balance sync, leverage-based position sizing, and removed daily trade limits - Added RPC status monitoring endpoint - Updated balance and positions APIs to use failover system - All Drift APIs now working correctly with accurate balance data
17 lines
436 B
JavaScript
17 lines
436 B
JavaScript
import { NextResponse } from 'next/server'
|
|
import { getRpcStatus } from '../../../lib/rpc-failover.js'
|
|
|
|
export async function GET() {
|
|
try {
|
|
const status = getRpcStatus()
|
|
return NextResponse.json(status)
|
|
} catch (error) {
|
|
console.error('❌ RPC Status error:', error)
|
|
return NextResponse.json({
|
|
success: false,
|
|
error: 'Failed to get RPC status',
|
|
details: error.message
|
|
}, { status: 500 })
|
|
}
|
|
}
|