Commit 908c908
Franz VETTER
🔧 Fix quantity precision error for OCO orders
🐛 Critical Bug Fix:
- Fixed 'Parameter quantity has too much precision' error (-1111)
- OCO orders failing on symbols with specific precision requirements
- ADA and other cryptos could not create OCO orders
🔧 Technical Problem:
- sell_quantity formatted with step_size alignment but wrong decimal precision
- Example: 40.90000000 ADA sent instead of 40.90 (ADA requires 2 decimals)
- Binance rejects orders with excessive decimal places
📊 Impact:
- OCO orders completely broken for precision-sensitive symbols
- Fallback to LIMIT orders (no stop-loss protection)
- ADA, DOGE and potentially other cryptos affected
✅ Solution:
- Calculate quantity precision from step_size: qty_precision = -log10(step_size)
- Apply proper rounding: round(quantity, qty_precision)
- Added debug logging for precision verification
- Consistent formatting across all symbols
🎯 All symbols now create OCO orders with correct quantity precision1 parent 461632c commit 908c908
1 file changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
480 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
481 | 484 | | |
482 | | - | |
| 485 | + | |
483 | 486 | | |
484 | | - | |
| 487 | + | |
| 488 | + | |
485 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
486 | 497 | | |
487 | 498 | | |
488 | 499 | | |
| |||
0 commit comments