Fixed Position Size Calculation: - Changed input from SOL to USD for clarity - Fixed calculation: positionSizeSOL = positionValueUSD / coinPrice - Resolved issue where entering 0.4 SOL showed incorrect 0.0025 underneath Added Real Wallet Balance Integration: - TradeModal now fetches actual wallet balance from /api/wallet/balance - Percentage buttons now calculate from real available balance (3.40) - No more impossible 1 SOL positions when only 3.40 available Enhanced Position Sizing UI: - Added slider for smooth position adjustment ( to full balance) - Percentage buttons (25%, 50%, 75%, 100%) now accurate - Real-time display shows both USD and SOL amounts - Live percentage display of balance usage Added Wallet Overview to Dashboard: - Main dashboard shows real wallet balance prominently - Trading page displays actual wallet holdings - StatusOverview component enhanced with wallet info - Accurate position sizing based on actual 3.40 balance - Intuitive slider + percentage buttons - Real-time balance updates every 30 seconds - Clear USD/SOL conversion display - No more calculation errors in trading modal
29 lines
888 B
JavaScript
29 lines
888 B
JavaScript
'use client'
|
|
import React, { useState } from 'react'
|
|
import AIAnalysisPanel from '../../components/AIAnalysisPanel.tsx'
|
|
|
|
export default function AnalysisPage() {
|
|
const [analysisResult, setAnalysisResult] = useState(null)
|
|
const [currentSymbol, setCurrentSymbol] = useState('SOL')
|
|
|
|
const handleAnalysisComplete = (analysis, symbol) => {
|
|
setAnalysisResult(analysis)
|
|
setCurrentSymbol(symbol || 'SOL')
|
|
}
|
|
|
|
return (
|
|
<div className="space-y-8">
|
|
<div className="flex items-center justify-between">
|
|
<div>
|
|
<h1 className="text-3xl font-bold text-white">AI Analysis</h1>
|
|
<p className="text-gray-400 mt-2">Get comprehensive market insights powered by AI analysis</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="max-w-6xl mx-auto">
|
|
<AIAnalysisPanel onAnalysisComplete={handleAnalysisComplete} />
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|