You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
specifically, setPosition can involve up to 3 calls to updateReservesAndVirtualSupply, which is responsible for updating reserves. it can be the case that it is impossible to add or remove reserves at the exact ratio of the current price, meaning that the price (reserve1Virtual/reserve0Virtual) changes. If liquidity is being added, the price can increase, if liquidity is being removed, the price can decrease. this is shown by assert statements in the code. so:
ideally, we would be able to formally prove that these asserts can never be reached, and remove them from the deployed bytecode
if the price ever moves outside of the current tick, this poses a problem, as we only want to run the tick transition logic for swaps. right now, this case is prevented by require statements in the code, though of course this is less than ideal
The text was updated successfully, but these errors were encountered:
specifically,
setPosition
can involve up to 3 calls toupdateReservesAndVirtualSupply
, which is responsible for updating reserves. it can be the case that it is impossible to add or remove reserves at the exact ratio of the current price, meaning that the price (reserve1Virtual/reserve0Virtual
) changes. If liquidity is being added, the price can increase, if liquidity is being removed, the price can decrease. this is shown byassert
statements in the code. so:ideally, we would be able to formally prove that these asserts can never be reached, and remove them from the deployed bytecode
if the price ever moves outside of the current tick, this poses a problem, as we only want to run the tick transition logic for swaps. right now, this case is prevented by
require
statements in the code, though of course this is less than idealThe text was updated successfully, but these errors were encountered: