Skip to content

Unexpected behavior in round_down function #142

@frank22lin

Description

@frank22lin

Hi,

The round_down function used in client.create_order and client.create_market_order seems to suffer from floating point precision issues.

See the attached example that demonstrates unexpected behavior when rounding certain values, which causes the makerAmount and takerAmount to be slightly off .

Image

Perhaps using the Decimal library here would fix this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions