This repository has been archived by the owner on Jan 7, 2025. It is now read-only.
0xLogos - Wrong price used to update updateGlobalPositionData in liquidate #278
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
High
A valid High severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
0xLogos
high
Wrong price used to update updateGlobalPositionData in liquidate
Summary
In
LiquidationModule::liquidate
when updating global position dataposition.lastPrice
is used insted ofcurrentPrice
Vulnerability Detail
In
FlatcoinVault::updateGlobalPositionData
there's comment "The current price of the underlying asset" for_price
parameter. But inliquidate
used staleposition.price
as the parameterposition.price
is the price of asset in time of last open/adjustmet and can be very different from from current priceImpact
Incorrect price used for
_globalPositions
and calculatingstableCollateralTotal
inFlatcoinVault
which is critical values for protocolCode Snippet
https://github.com/sherlock-audit/2023-12-flatmoney/blob/bba4f077a64f43fbd565f8983388d0e985cb85db/flatcoin-v1/src/LiquidationModule.sol#L160
Tool used
Manual Review
Recommendation
Use
currentPrice
insteadDuplicate of #188
The text was updated successfully, but these errors were encountered: