feat: add quality score display and timezone fixes

- Add qualityScore to ExecuteTradeResponse interface and response object
- Update analytics page to always show Signal Quality card (N/A if unavailable)
- Fix n8n workflow to pass context metrics and qualityScore to execute endpoint
- Fix timezone in Telegram notifications (Europe/Berlin)
- Fix symbol normalization in /api/trading/close endpoint
- Update Drift ETH-PERP minimum order size (0.002 ETH not 0.01)
- Add transaction confirmation to closePosition() to prevent phantom closes
- Add 30-second grace period for new trades in Position Manager
- Fix execution order: database save before Position Manager.addTrade()
- Update copilot instructions with transaction confirmation pattern
This commit is contained in:
mindesbunister
2025-11-01 17:00:37 +01:00
parent 7788327a4e
commit 056440bf8f
9 changed files with 110 additions and 49 deletions

View File

@@ -127,11 +127,11 @@ export const SUPPORTED_MARKETS: Record<string, MarketConfig> = {
symbol: 'ETH-PERP',
driftMarketIndex: 2,
pythPriceFeedId: '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
minOrderSize: 0.01, // 0.01 ETH minimum
minOrderSize: 0.002, // 0.002 ETH minimum (~$7-8 for safety above $4 Drift minimum)
tickSize: 0.01,
// DATA COLLECTION MODE: Minimal risk (Drift minimum 0.01 ETH = ~$38)
positionSize: 40, // $40 base capital (meets exchange minimum)
leverage: 1, // 1x leverage = $40 total exposure
// DATA COLLECTION MODE: Minimal risk
positionSize: 8, // $8 base capital (ensures 0.002 ETH at ~$4000/ETH)
leverage: 1, // 1x leverage = $8 total exposure
},
}