QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: high
Valid

Uplift Fee Bypass Through NFT Transfer

Summary

The contract's fee mechanism can be bypassed by transferring NFTs, allowing users to reset their deposit value and avoid paying uplift fees on gains.

Vulnerability Details

In the afterUpdate function, called during NFT transfers, the contract updates the deposit value to the current value:

if (_to != address(0)) {
feeDataArray[tokenIdIndex].lpTokenDepositValue = lpTokenDepositValueNow;
feeDataArray[tokenIdIndex].blockTimestampDeposit = uint32(block.number);
feeDataArray[tokenIdIndex].upliftFeeBps = upliftFeeBps;
}

in onAfterRemoveLiquidity, the fee calculation is based on the change since deposit:

localData.lpTokenDepositValueChange = (int256(localData.lpTokenDepositValueNow) - int256(localData.lpTokenDepositValue)) / int256(localData.lpTokenDepositValue);
if (localData.lpTokenDepositValueChange > 0) {
feePerLP = (uint256(localData.lpTokenDepositValueChange) * (uint256(feeDataArray[i].upliftFeeBps) * 1e18)) / 10000;
} else {
feePerLP = (uint256(minWithdrawalFeeBps) * 1e18) / 10000;
}

This creates an exploitable scenario where users can avoid paying uplift fees by:

  1. Depositing when price is low (e.g., 100)

  2. Price increases (e.g., to 150)

  3. Instead of withdrawing and paying uplift fees on the 50% gain, user:

  • Transfers NFT to another wallet

  • During transfer, lpTokenDepositValue is updated to 150

  • Withdraws immediately after

  • Pays only minimum fee since there's no gain from new deposit value

Impact

HIGH - This vulnerability fundamentally breaks the economic model of the protocol by allowing users to bypass the uplift fee mechanism entirely through a simple transfer. The protocol loses revenue, and the intended fee structure becomes optional.

Tools Used

manual review

Recommendations

Remove the lpTokenDepositValue update during transfers:

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_afterUpdate_bypass_fee_collection_updating_the_deposited_value

Likelihood: High, any transfer will trigger the bug. Impact: High, will update lpTokenDepositValue to the new current value without taking fees on profit.

Support

FAQs

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

Give us feedback!