QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: medium
Invalid

during fast market movements, UpLift fees will be charged unfairly

Summary

Since UpliftOnlyExample can be associated with normal balancerV3 pools, users could be charged upLiftFee when actually the pool didn't have any activity

Vulnerability Details

NOTE!: we need to take into considerations that UpliftOnlyExample is a normal hook that can be chosen for other standard Balancer V3 pools

when user deposits, their share price gets stored in their poolsFeeData to be used later for fees charging during removal of liquidity

File: UpliftOnlyExample.sol
function addLiquidityProportional
244: uint256 depositValue = getPoolLPTokenValue(
245: IUpdateWeightRunner(_updateWeightRunner).getData(pool),
246: pool,
247: MULDIRECTION.MULDOWN
248: );
249:
250: poolsFeeData[pool][msg.sender].push(
251: FeeData({
252: tokenID: tokenID,
253: amount: exactBptAmountOut,
254: //this rounding favours the LP
255: lpTokenDepositValue: depositValue,
256: //known use of timestamp, caveats are known.
257: blockTimestampDeposit: uint40(block.timestamp),
258: upliftFeeBps: upliftFeeBps
259: })
260: );

But the problem here is that there can be times where if the pool is Quant weighted or normal balancerV3, uplift fees will be charged on withdrawals, although there were no earned swap fees or no weight changes of the pool, here is how

  1. User deposits 50-50 wBTC/USDC (BTC = 10K)

  2. wBTC price suddenly spikes to 12K, no rule changing weights for quantAMM weighted pool, and no manual weight changes for normal balancer V3 pools yet

  3. user want to withdraw after

  4. getPoolLPTokenValue will be called during onAfterRemoveLiquidity and will charge the user upLift fees as if the pool caused his value to grow (which is not)

Impact

unfair fees charges to LP during withdrawals

Tools Used

Manual review

Recommendations

implement tracking systems to see how much the system actually caused upLift to the user and not blindly charge upLift fees from current market value only

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.