Open
Description
Multiple related issues:
- no point to leave small amounts in order book on either side
- 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 - 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.