Submitted by ayden, also found by ZanyBonzy, emmac002, Tigerfrake, BlockSafe, 0xhere2learn, Yunaci, air_0x, and Takarez
Anyone can invoke the reallocate function to reallocate the LP position to be within the desired range. Whether reallocation is necessary depends on the slot0 price. However, the slot0 price can be manipulated, potentially leading to the LP position being out of the current range and resulting in a loss of yield for the protocol.
Reallocate first read slot0 Perp.sol::reallocate to get current price:
Then, compare current price with the threshold Perp.sol::reallocate:
Once out of range protocol invoke Perp.sol::swapForOutOfRange to update rebalance position:
Foundry
Its recommend to use TWAP price instead of slot0 price to get the current price.
Invalid Validation
0xsomeone (judge) increased severity to High and commented:
Tripathi (warden) commented:
0xsomeone (judge) commented:
Tripathi (warden) commented:
0xsomeone (judge) commented:
syuhei176 (Predy) confirmed
Note: For full discussion, see here.
