smart-contracts icon indicating copy to clipboard operation
smart-contracts copied to clipboard

liquidity reserve might show 0 rates for both sides when exceeding price limits

Open yaronvel opened this issue 5 years ago • 2 comments

would be better to only block one side.

yaronvel avatar May 07 '19 12:05 yaronvel

what is liquidity reserve? what are the price limits?

On Tue, May 7, 2019 at 3:21 PM yaronvel [email protected] wrote:

would be better to only block one side.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/KyberNetwork/smart-contracts/issues/403, or mute the thread https://github.com/notifications/unsubscribe-auth/ACNXTBPWLLZWELWH2GLJPTDPUFX5XANCNFSM4HLII42A .

ilanDoron avatar May 07 '19 12:05 ilanDoron

this https://github.com/KyberNetwork/smart-contracts/blob/master/contracts/LiquidityConversionRates.sol#L201

When price goes below min rate for buy it will typically also go over max rate for sell. In principle it usually happens when inventory of one side is depleted, and then you still want to allow users to buy the other side.

However the calculation is not always correct, and as a result when one side is depleted also the other side is blocked. Which is not the end of the world, but one might argue it is not optimal.

yaronvel avatar May 07 '19 12:05 yaronvel