Skip to content

handle dust / rounding on exchange order match #21

Open
@szerintedmi

Description

@szerintedmi

Multiple related issues:

  1. no point to leave small amounts in order book on either side
  2. placing & matching 100A€ sell and 100A€ worth of ETH buy orders leaves 0.0001 A€ on buy side. See test case in exchange_fiddling branch
  3. likely related, rounding issue on small amount: 0 orderfill on rinkeby with an earlier version

Proposed solution:
a) Use roundedDiv for both sellWei and tradedTokens calculation in _fillOrder. It's a solution for issue 2.
b) On fill increase the fill buy or sell amount if the leftover is smaller than a parameter. It would resolve all the above issues. Need to think over if there is any potential abuse of this rule.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions