Skip to content

Calculate correct amounts and prices for orders #511

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions