Calculate correct amounts and prices for orders #511
Labels
[2] Advanced Issue
Issue is a technically advanced or complex task. Requires prior knowledge
[2] Needs Verification
Issue needs verification
[3] Type: Enhancement
[4] Priority: Low
Projects
DEX orders can be always accurately expressed as fractional numbers, not decimal numbers. Strategies should calculate the exact fractional price and amounts that are actually possible, and use those values in the logic. They can be represented accurately enough using floats, but not every float value is possible. Placing orders that result in something else than expected causes hard to understand situations, and can be hard to debug. I suggest a method that, given a target price and amount, can return the closest actually possible values - which then can be further used in strategie's logic's.
The text was updated successfully, but these errors were encountered: