Increasing the length of the long term swaps causes most tests to fail. For example, setting blockInterval to 500 causes the received values to differ from the expected by as much as 30%.
I believe this to be a result of sellingRate being casted to an integer value.
uint256 sellingRate = amount / (orderExpiry - currentBlock);
In cases where amount is close to the number of blocks the order is selling over, this results in a drastic effect.
For example, selling 10,000 tokens over 5,000 blocks results in a sellingRate of 1.977, which is cast to 1, resulting in the user only receiving around half as many tokens as expected.
Increasing the length of the long term swaps causes most tests to fail. For example, setting blockInterval to 500 causes the received values to differ from the expected by as much as 30%.
I believe this to be a result of sellingRate being casted to an integer value.
uint256 sellingRate = amount / (orderExpiry - currentBlock);In cases where amount is close to the number of blocks the order is selling over, this results in a drastic effect.
For example, selling 10,000 tokens over 5,000 blocks results in a sellingRate of 1.977, which is cast to 1, resulting in the user only receiving around half as many tokens as expected.