Submitted by TomFrenchBlockchain
IL isnt properly converted from being in terms of USDV to VADER, resulting in reserve paying out incorrect amount.
VaderReserve.reimburseImpermanentLoss receives an amount in terms of USDV and converts this to an amount of VADER to send to recipient.
However as shown in the link if there is a previous price stored for USDV, the amount of VADER tokens to be sent to the recipient is amount / usdvPrice.
https://github.com/code-423n4/2021-12-vader/blob/fd2787013608438beae361ce1bb6d9ffba466c45/contracts/reserve/VaderReserve.sol#L84-L110
usdvPrice is the total USD value of foreign assets divided by the total amount of USDV in a number of pairs. Its then some measure of the inverse of the price of USDV in USD, nothing to do with converting into VADER.
The reserve will then improperly calculate the amount of VADER to pay out once there is a single reading of the USDV price.
It looks like both branches of this if statement are supposed to be run, i.e. convert from USDV to USD and then to VADER but I cant be sure. Care should be taken so that the calculation being performed is the expected one.
SamSteinGG (Vader) acknowledged
