mindesbunister bf9022b699 Fix trading history: implement proper P&L tracking for closed positions
- Fixed trading history not showing closed positions with positive P&L
- Implemented multi-source trading history fetching (SDK, Data API, DLOB, local DB)
- Added proper P&L calculation using unrealized PnL from Drift positions
- Enhanced TradingHistory component with error handling and sync functionality
- Added manual sync button and better status messages
- Created /api/drift/sync-trades endpoint for manual trade synchronization
- Fixed database integration to properly store and retrieve trades with P&L
- Added comprehensive fallback mechanisms for data fetching
- Improved error messages and user feedback
- Added TRADING_HISTORY_IMPROVEMENTS.md documentation

This addresses the issue where recently closed positions with positive P&L
were not appearing in the trading history section.
2025-07-13 10:18:56 +02:00

Trading Bot v3

This project is a Next.js 15 App Router dashboard for automated trading, AI-powered analysis, and developer tools. It uses TypeScript, Tailwind CSS, Prisma, and provides API endpoints for trading, analysis, and automation.

Features

  • Modern Next.js 15 App Router architecture
  • TypeScript, Tailwind CSS, ESLint, Turbopack
  • API routes for trading, analysis, screenshots, and automation
  • Ready for integration with Prisma, OpenAI, TradingView, and Solana/Drift

Getting Started

  1. Install dependencies:
    npm install
    
  2. Run the development server:
    npm run dev
    
  3. Open http://localhost:3000 in your browser.

Customization

  • Add your business logic, UI components, and database schema as needed.
  • See .github/copilot-instructions.md for Copilot guidance.

This project is ready for migration of your trading bot logic and UI from v2.

Description
No description provided
Readme 79 MiB
Languages
TypeScript 70.1%
JavaScript 27.6%
Shell 1.6%
Dockerfile 0.4%
CSS 0.3%