Submitted by gumgumzum
https://github.com/code-423n4/2024-05-predy/blob/main/src/PriceFeed.sol#L29-L59https://github.com/code-423n4/2024-05-predy/blob/main/src/libraries/PositionCalculator.sol#L141-L149https://github.com/code-423n4/2024-05-predy/blob/main/src/libraries/PositionCalculator.sol#L83https://github.com/code-423n4/2024-05-predy/blob/main/src/libraries/PositionCalculator.sol#L70https://github.com/code-423n4/2024-05-predy/blob/main/src/libraries/PositionCalculator.sol#L41https://github.com/code-423n4/2024-05-predy/blob/main/src/libraries/PositionCalculator.sol#L56https://github.com/code-423n4/2024-05-predy/blob/main/src/markets/perp/PerpMarketV1.sol#L227https://github.com/code-423n4/2024-05-predy/blob/main/src/markets/perp/PerpMarketV1.sol#L114-L115https://github.com/code-423n4/2024-05-predy/blob/main/src/markets/gamma/GammaTradeMarket.sol#L237https://github.com/code-423n4/2024-05-predy/blob/main/src/markets/gamma/GammaTradeMarket.sol#L286https://github.com/code-423n4/2024-05-predy/blob/main/src/markets/gamma/GammaTradeMarket.sol#L346https://github.com/code-423n4/2024-05-predy/blob/main/src/PredyPool.sol#L352-L354https://github.com/code-423n4/2024-05-predy/blob/main/src/libraries/logic/TradeLogic.sol#L55-L56https://github.com/code-423n4/2024-05-predy/blob/main/src/libraries/logic/TradeLogic.sol#L47-L48https://github.com/code-423n4/2024-05-predy/blob/main/src/libraries/logic/ReaderLogic.sol#L35-L36https://github.com/code-423n4/2024-05-predy/blob/main/src/libraries/logic/LiquidationLogic.sol#L75-L76https://github.com/code-423n4/2024-05-predy/blob/main/src/libraries/logic/LiquidationLogic.sol#L141-L142
Discrepancy in PositionCalculator@getSqrtIndexPrice (cascading down the line to anywhere it is used) when using a PriceFeed or not.
This makes parts of the system unusable for quote pairs (e.g., when selling, position is not safe in PerpMarket since the vault value ends up being very low and the vault margin being negative) and may lead to other problems if at first a PriceFeed is not used but then is updated later since the computed state will change after the update.
Its not possible to create a PriceFeed with a fraction as decimalsDiff.
For base pairs, its not an issue, but for quote pairs it makes it impossible to get the correct price.
For example, for the USDC/WETH, the base pair PriceFeed would have a 1e12 decimalsDiff but the quote pair PriceFeed should have a 1e12 decimalsDiff which is not possible (the lower you can go is 1e0).
Oracle
syuhei176 (Predy) disputed and commented:
0xsomeone (judge) commented:
gumgumzum (warden) commented:
0xsomeone (judge) commented:
gumgumzum (warden) commented:
0xsomeone (judge) commented:
syuhei176 (Predy) commented:
0xsomeone (judge) commented:
syuhei176 (Predy) commented:
0xsomeone (judge) commented:
syuhei176 (Predy) commented:
0xsomeone (judge) commented:
syuhei176 (Predy) acknowledged
For this audit, 4 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by Bauchibred received the top score from the judge.
The following wardens also submitted reports: Rhaydden, Sathish9098, and ZanyBonzy.
