QuantAMM

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

Pool creators don't receive upLift fees

Summary

The UpliftOnlyExample contract has a discrepancy between the whitepaper specification and implementation where pool creators are not receiving their entitled fees from LP value uplift, instead fees are being split between QuantAdmin and LP donations.

Vulnerability Details

In the onAfterRemoveLiquidity function, when fees are collected from LP withdrawals, the fees are split into two parts:

1- QuantAdmin portion based on adminFeePercent:

if (localData.adminFeePercent > 0) {
_vault.addLiquidity(
AddLiquidityParams({
pool: localData.pool,
to: IUpdateWeightRunner(_updateWeightRunner).getQuantAMMAdmin(),
maxAmountsIn: localData.accruedQuantAMMFees,
minBptAmountOut: localData.feeAmount.mulDown(localData.adminFeePercent) / 1e18,
kind: AddLiquidityKind.PROPORTIONAL,
userData: bytes("")
})
);
}

2- Remaining portion donated back to LPs:

if (localData.adminFeePercent != 1e18) {
_vault.addLiquidity(
AddLiquidityParams({
pool: localData.pool,
to: msg.sender,
maxAmountsIn: localData.accruedFees,
minBptAmountOut: 0,
kind: AddLiquidityKind.DONATION,
userData: bytes("")
})
);
}

There is no mechanism to distribute fees to pool creators as specified in the whitepaper.

Impact

  • Pool creators are not receiving their entitled fees from LP value uplift

Tools Used

Manual review

Recommendations

1- Add pool creator fee distribution:

if (poolCreatorFeePercent > 0) {
_vault.addLiquidity(
AddLiquidityParams({
pool: localData.pool,
to: poolCreator,
maxAmountsIn: localData.accruedPoolCreatorFees,
minBptAmountOut: localData.feeAmount.mulDown(poolCreatorFeePercent) / 1e18,
kind: AddLiquidityKind.PROPORTIONAL,
userData: bytes("")
})
);
}

2- Update fee splitting logic to accommodate three-way split between:

- QuantAdmin
- Pool Creator
- LP donation

3- Add pool creator address storage and fee percentage configuration

4- Update documentation to clearly specify fee distribution model

Updates

Lead Judging Commences

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

Appeal created

huntoor Submitter
11 months ago
huntoor Submitter
11 months ago
n0kto Lead Judge
11 months ago
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.

Give us feedback!