Skip to content

Calculate correct amounts and prices for orders #511

@MarkoPaasila

Description

@MarkoPaasila

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions