diff --git a/app/analysis/page.js b/app/analysis/page.js
index 652e018..0760a63 100644
--- a/app/analysis/page.js
+++ b/app/analysis/page.js
@@ -1,7 +1,6 @@
'use client'
import React, { useState } from 'react'
import AIAnalysisPanel from '../../components/AIAnalysisPanel.tsx'
-import TradeExecutionPanel from '../../components/TradeExecutionPanel.js'
export default function AnalysisPage() {
const [analysisResult, setAnalysisResult] = useState(null)
@@ -16,22 +15,13 @@ export default function AnalysisPage() {
-
AI Analysis & Trading
-
Get market insights and execute trades based on AI recommendations
+
AI Analysis
+
Get comprehensive market insights powered by AI analysis
-
)
diff --git a/app/analysis/page_fixed.js b/app/analysis/page_with_trading_panel.js.backup
similarity index 100%
rename from app/analysis/page_fixed.js
rename to app/analysis/page_with_trading_panel.js.backup
diff --git a/app/globals.css b/app/globals.css
index 8e4c6c8..6450dbb 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -52,3 +52,44 @@ body {
transform: translateY(-2px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
+
+/* Custom range slider styling */
+input[type="range"] {
+ -webkit-appearance: none;
+ appearance: none;
+ height: 8px;
+ background: linear-gradient(to right, #3B82F6 0%, #3B82F6 30%, #374151 30%, #374151 100%);
+ border-radius: 4px;
+ outline: none;
+ cursor: pointer;
+}
+
+input[type="range"]::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ appearance: none;
+ width: 20px;
+ height: 20px;
+ background: #3B82F6;
+ border-radius: 50%;
+ cursor: pointer;
+ border: 2px solid #1e40af;
+ box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
+}
+
+input[type="range"]::-moz-range-thumb {
+ width: 20px;
+ height: 20px;
+ background: #3B82F6;
+ border-radius: 50%;
+ cursor: pointer;
+ border: 2px solid #1e40af;
+ box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
+}
+
+input[type="range"]:focus::-webkit-slider-thumb {
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
+}
+
+input[type="range"]:focus::-moz-range-thumb {
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
+}
diff --git a/app/trading/page.js b/app/trading/page.js
index d0f9155..ca8bc23 100644
--- a/app/trading/page.js
+++ b/app/trading/page.js
@@ -18,16 +18,22 @@ export default function TradingPage() {
useEffect(() => {
fetchBalance()
+ // Refresh balance every 30 seconds to keep it current
+ const interval = setInterval(fetchBalance, 30000)
+ return () => clearInterval(interval)
}, [])
const fetchBalance = async () => {
setLoading(true)
try {
- const response = await fetch('/api/trading/balance')
+ // Use the real wallet balance API
+ const response = await fetch('/api/wallet/balance')
const data = await response.json()
if (data.success) {
setBalance(data.balance)
+ } else {
+ console.error('Failed to fetch balance:', data.error)
}
} catch (error) {
console.error('Failed to fetch balance:', error)
diff --git a/components/StatusOverview.js b/components/StatusOverview.js
index 65dff68..0529924 100644
--- a/components/StatusOverview.js
+++ b/components/StatusOverview.js
@@ -8,7 +8,9 @@ export default function StatusOverview() {
dailyPnL: 0,
systemStatus: 'offline',
bitqueryStatus: 'unknown',
- marketPrices: []
+ marketPrices: [],
+ walletBalance: null, // Real wallet balance
+ availableCoins: [] // Available coins in wallet
})
const [loading, setLoading] = useState(true)
@@ -17,8 +19,25 @@ export default function StatusOverview() {
try {
setLoading(true)
+ // Get real wallet balance
+ let walletBalance = null
+ let availableCoins = []
+
+ try {
+ const walletRes = await fetch('/api/wallet/balance')
+ if (walletRes.ok) {
+ const walletData = await walletRes.json()
+ if (walletData.success) {
+ walletBalance = walletData.balance
+ availableCoins = walletData.balance.positions || []
+ }
+ }
+ } catch (e) {
+ console.warn('Could not fetch wallet balance:', e)
+ }
+
// Get market data from Bitquery
- let balance = 0
+ let balance = walletBalance?.totalValue || 0 // Use real wallet balance
let bitqueryStatus = 'error'
let marketPrices = []
@@ -29,15 +48,6 @@ export default function StatusOverview() {
if (marketData.success) {
marketPrices = marketData.data.prices || []
bitqueryStatus = marketData.data.status?.connected ? 'online' : 'error'
-
- // Calculate portfolio value from Bitquery
- const portfolioRes = await fetch('/api/trading/balance')
- if (portfolioRes.ok) {
- const portfolioData = await portfolioRes.json()
- if (portfolioData.success) {
- balance = portfolioData.balance.totalValue || 0
- }
- }
}
}
} catch (e) {
@@ -61,7 +71,9 @@ export default function StatusOverview() {
dailyPnL: 0, // No fake P&L
systemStatus: systemStatus,
bitqueryStatus: bitqueryStatus,
- marketPrices: marketPrices
+ marketPrices: marketPrices,
+ walletBalance: walletBalance,
+ availableCoins: availableCoins
})
} catch (error) {
console.error('Error fetching status:', error)
@@ -119,6 +131,19 @@ export default function StatusOverview() {
Portfolio Value
+ {/* Wallet Balance */}
+ {status.walletBalance && (
+