Macho Sangria Python
Medium
Mint charges unreasonable fee when there is only one asset in vault
Summary
When the vault has only one asset, every mint except the first might incur a significant fee, since the newRatio is always 1e27, which is above mintKinkRatio and optimalRatio, which causes high amount of fee.
Root Cause
The issue is at https://github.com/sherlock-audit/2025-07-cap/blob/main/cap-contracts/contracts/vault/libraries/MinterLogic.sol#L94
The _amountOutBeforeFee function in MinterLogic.sol calculates the newRatio of the asset relative to the total value, which is used to determine the fee. During the minting process, a high newRatio is intended to indicate an imbalance in asset composition and results in a higher fee. However, when there is only one asset in the vault, the minter should not be penalized, as they have no option to supply other assets.
Internal Pre-conditions
- User is not on the whitelist for the fee exemption.
- This is not the first mint.
- The
feeData has been set with a non-zero slope0 or slope1.
External Pre-conditions
No External Pre-conditions
Attack Path
The high fee occurs during minting when the capToken supply is greater than zero.
Impact
The high fee will make the minter unwilling to deposit tokens in a vault that contains only one asset.
PoC
No response
Mitigation
Add another check to exempt the high fee in cases where the vault has only one asset.