Files
trading_bot_v3/app/api/session-status/route.ts
mindesbunister 8e0d7f0969 Fix Net USD Value calculation to match Drift exactly
- Enhanced getAccountBalance() with comprehensive Drift SDK methods
- Added detection for direct net USD value methods (getNetUsdValue, getEquity, getTotalAccountValue)
- Included unsettled balances and funding payments in calculation
- Fixed Net USD Value accuracy: now shows 69.34 matching Drift interface exactly
- Disabled problematic TradingView automation temporarily to focus on Drift integration
- All dashboard metrics now reflect 100% accurate real-time Drift account data
- Position data, balances, and Net USD Value all perfectly synchronized with Drift Protocol
2025-07-13 01:13:35 +02:00

48 lines
1.4 KiB
TypeScript

import { NextRequest, NextResponse } from 'next/server'
export async function GET(request: NextRequest) {
try {
console.log('📊 Session status temporarily disabled due to TradingView automation parsing issues')
// Return a basic response instead of using TradingView automation
return NextResponse.json({
isAuthenticated: false,
status: 'disabled',
message: 'TradingView session status temporarily disabled - focusing on Drift integration',
session: {
isAuthenticated: false,
hasSavedCookies: false,
hasSavedStorage: false,
cookiesCount: 0,
currentUrl: '',
connectionStatus: 'disabled',
lastChecked: new Date().toISOString(),
dockerEnv: process.env.DOCKER_ENV === 'true',
environment: process.env.NODE_ENV || 'development'
}
})
} catch (error: any) {
console.error('❌ Session status error:', error.message)
return NextResponse.json({
isAuthenticated: false,
status: 'error',
message: error.message
}, { status: 500 })
}
}
export async function POST(request: NextRequest) {
try {
return NextResponse.json({
success: false,
message: 'TradingView automation temporarily disabled - focusing on Drift integration'
})
} catch (error: any) {
return NextResponse.json({
success: false,
error: error.message
}, { status: 500 })
}
}