twapFilter()
may show incorrect price for negative ticks cause it doesn't round up for negative ticks
#506
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-195
grade-b
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
🤖_195_group
AI based duplicate group recommendation
Lines of code
https://github.com/code-423n4/2024-04-panoptic/blob/833312ebd600665b577fbd9c03ffa0daf250ed24/contracts/libraries/PanopticMath.sol#L241-#L268
Vulnerability details
Vulnerability details
In
twapFilter()
function, it calculate average tick per 30s window:The problem is that it does not round to negative in specific case like in uniswap library, then returned tick will be bigger then it should be, which opens possibility for some price manipulations and arbitrage opportunities.
Impact
tick result can be bigger than it should be
Tools Used
Manual review
Recommended Mitigation Steps
Tick should be rounded down in that case:
Assessed type
Context
The text was updated successfully, but these errors were encountered: