Skip to content

Rounding sucks, we need to round price more accurately. #126

@R-K-H

Description

@R-K-H

Describe the bug
We don't accurately round price to the 4th decimal 0.0001 which leads to poor UX from the UI.

To Reproduce
Set a non whole number price.
Place limit order.
See it not work with that price.

Expected behavior
That price is precise.

Additional context

let priceLots = new BN(Math.floor(price / QUOTE_LOTS));

Is where I think it is. But it could be coming from the UI as well. We really should sanitize these values as well before blindly adding them into a TXN. I suggest we ensure the values match and if not we send message back to the UI for error handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions