If AAVE reaches its supply cap for a collateral asset, users will be unable to add liquidity to existing DIVA pools created through the AaveDIVAWrapper. This can disrupt ongoing campaigns, such as donation pools, by preventing additional contributions.
A campaign is created using the AaveDIVAWrapper, which supplies collateral to AAVE and mints WTokens.
Over time, as the campaign proves successful, additional liquidity is expected to be added.
Before more liquidity is supplied, AAVE reaches its supply cap for that collateral asset.
Since AAVE no longer accepts new deposits, aave.supply() will revert, preventing WToken minting.
Without WTokens, adding liquidity to the existing DIVA pool becomes impossible, creating a DOS for liquidity provition to the pool.
A donation campaign starts with initial funding.
As trust builds, more liquidity is added to the pool through addLiquidity().
If AAVE’s supply cap is hit in the meantime, additional liquidity can no longer be added, blocking further donations.
The only alternative would be to create a new DIVA pool, requiring previous liquidity to be removed and re-supplied, which incurs additional protocol fees. Also this should be made interacting directly with DIVA protocol, which is costly and time consuming developer-wise.
Users will be unable to add liquidity to DIVA pools when AAVE reaches its supply cap of the collateral asset for aToken.
Campaigns relying on incremental liquidity will be disrupted without warning.
Users will be forced to remove and recreate pools, leading to unnecessary and unfair extra fees in the DIVA Protocol.
Since WTokens can only be minted via the wrapper's _handleTokenOperations() (see here), which is the function calling supply() (reverts if max supply reached, see here). Directly adding liquidity through DIVA contracts is not an option. As the collateral in the exisitng DIVA pool is the WToken and no-one can get that token anymore.
A fallback mechanism should be implemented in the wrapper to handle cases where AAVE reaches its supply cap:
Detect when AAVE’s supply cap is reached using existing AAVE contract functions.
Redirect collateral to an escrow contract instead of attempting to supply it to AAVE.
Allow WTokens to be minted regardless, using the escrowed collateral instead of aTokens.
Once AAVE allows new deposits again, a function should allow the escrowed collateral to be supplied to AAVE.
This ensures that donation campaigns and other use cases remain uninterrupted, even when AAVE reaches temporary supply limits.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.