Fix Drift trading execution: leverage, stop loss, and take profit

- Fix leverage application in trade execution (was not being applied)
- Fix stop loss orders with proper OrderTriggerCondition.BELOW/ABOVE
- Fix take profit orders with TRIGGER_LIMIT order type
- Add OrderTriggerCondition import from Drift SDK
- Increase minimum stop loss from 0.5% to 3% to prevent cancellation
- Improve error logging for stop loss placement failures
- Add comprehensive risk management parameter validation
- Update order placement logic with proper trigger conditions

All trading functionality now working:
 Leverage application (2x, 5x, etc)
 Stop loss orders (minimum 3% for stability)
 Take profit orders (minimum 1%)
 Account balance calculations
 Progress tracking and UI enhancements
This commit is contained in:
mindesbunister
2025-07-23 15:26:14 +02:00
parent bdb8f21290
commit 0828647e80
3 changed files with 48 additions and 22 deletions

Binary file not shown.