## New Mobile Screens ### PortfolioScreen () Complete portfolio management screen with: - **Total P&L Display**: Large total P&L with USD conversion - **P&L History Chart**: 7-day line chart showing profit trends - **Balance Distribution**: Pie chart for DEX vs Polymarket allocation - **Platform Balances**: Detailed breakdown of DEX and Polymarket - BNB balance with P&L (DEX) - USDC balance with P&L (Polymarket) - **Performance Metrics**: Grid showing total trades, win rate, avg profit, profit factor - **Charts**: Using react-native-chart-kit for LineChart and PieChart - **Auto-refresh**: Updates every 30 seconds - **Pull-to-refresh**: Manual refresh support ### AnalyticsScreen (`mobile/src/screens/AnalyticsScreen.tsx`) Advanced analytics dashboard with: - **Timeframe Selector**: 7D, 30D, 90D toggle buttons - **Key Metrics Cards**: - Total Trades - Win Rate (color-coded: green ≥60%, yellow <60%) - Total P&L (green/red based on profit/loss) - Pending Trades - **Trade Volume Chart**: Bar chart showing daily trade counts - **P&L Trend Chart**: Line chart with profit/loss over time - **Trade Highlights**: - Best Trade card with profit details - Worst Trade card with loss details - **Performance Breakdown**: Profitable, losing, completed, pending trades - **AI Insights**: Smart suggestions based on win rate and P&L - **Auto-refresh**: Updates every 60 seconds ### OpportunitiesScreen (`mobile/src/screens/OpportunitiesScreen.tsx`) Live arbitrage opportunities scanner with: - **Filter System**: All, Arbitrage, Flash Loan tabs - **Opportunity Cards**: Each showing: - Type icon and color-coded label - Confidence badge (green ≥70%, yellow <70%) - Token pair (if applicable) - DEX route (buy → sell) - Expected profit in BNB - Discovery timestamp - Execute button - **Real-time Updates**: Refreshes every 15 seconds - **Execute Confirmation**: Alert dialog before execution - **Empty State**: Helpful message when no opportunities found - **Pull-to-refresh**: Manual refresh support ## App Navigation Updates Updated `mobile/App.tsx`: - ✅ Added navigation for Portfolio screen - ✅ Added navigation for Analytics screen - ✅ Added navigation for Opportunities screen - ✅ All screens use dark theme (#0a0a0a background, #00ff00 accent) - ✅ Stack navigation with proper headers ## Package.json Updates Added chart dependencies: - `react-native-chart-kit`: ^6.12.0 - For charts (LineChart, BarChart, PieChart) - `react-native-svg`: 15.2.0 - Required by chart-kit ## Mobile App Features The mobile app now has: 1. **7 Complete Screens**: Dashboard, Bot Control, Trades, Settings, Portfolio, Analytics, Opportunities 2. **Real-time Data**: All screens fetch live data from backend API 3. **Charts & Visualizations**: Line charts, bar charts, pie charts 4. **Auto-refresh**: Configurable intervals for each screen 5. **Pull-to-refresh**: User-initiated data reload 6. **Modern UI**: Dark theme with green accents 7. **Performance Metrics**: Comprehensive trading analytics 8. **Live Opportunities**: Real-time arbitrage scanner 9. **Push Notifications**: Configured and ready ## Usage ```bash cd mobile npm install # Install new chart dependencies expo start # Start Expo development server ``` All mobile screens are fully functional with real API integration!
34 lines
915 B
JSON
34 lines
915 B
JSON
{
|
|
"name": "immortal-bot-mobile",
|
|
"version": "1.0.0",
|
|
"description": "Immortal AI Trading Bot Mobile App",
|
|
"main": "index.js",
|
|
"scripts": {
|
|
"start": "expo start",
|
|
"android": "expo start --android",
|
|
"ios": "expo start --ios",
|
|
"web": "expo start --web"
|
|
},
|
|
"dependencies": {
|
|
"expo": "~51.0.0",
|
|
"react": "18.2.0",
|
|
"react-native": "0.74.0",
|
|
"expo-notifications": "~0.28.0",
|
|
"@react-navigation/native": "^6.1.9",
|
|
"@react-navigation/stack": "^6.3.20",
|
|
"react-native-screens": "~3.31.1",
|
|
"react-native-safe-area-context": "4.10.1",
|
|
"axios": "^1.6.0",
|
|
"@walletconnect/react-native-compat": "^2.10.0",
|
|
"react-native-webview": "13.8.6",
|
|
"react-native-chart-kit": "^6.12.0",
|
|
"react-native-svg": "15.2.0"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/core": "^7.20.0",
|
|
"@types/react": "~18.2.45",
|
|
"typescript": "^5.1.3"
|
|
},
|
|
"private": true
|
|
}
|