3

Here is a scenario I am simulating on a Hardhat Avalanche Mainnet fork:

  1. Supply USDC to AaveV3.
  2. Borrow WAVAX.
  3. Wait four weeks.
  4. Claim WAVAX rewards.
  5. Swap the rewards into USDC via a UniswapV2-like pair.
  6. Supply the USDC into AaveV3.

Step 6 fails with error code '51', which according to AaveV3 docs is 'Variable borrow index overflow' (https://docs.aave.com/developers/v/2.0/guides/troubleshooting-errors#reference-guide).

I have looked through the docs but am yet to find a coherent explanation of what that means. My working theory is that the actual fail point is here (https://github.com/aave/aave-v3-core/blob/feb3f20885c73025f40cc272b59e7eacfaa02fe4/contracts/protocol/libraries/logic/ValidationLogic.sol#L71-L77), and that the issue is that there is some sort of global maximum supply for a given type of collateral which cannot be exceeded.

Is my theory correct? If not, what does error '51' actually mean? Links to documentation, code, or authoritative sources appreciated if applicable.

PS – Can't post this question to the Aave Discord because it's broken and doesn't let me join.

1 Answer 1

1

Indeed, it seems that this is an innovation specific to V3: https://docs.aave.com/developers/whats-new/supply-borrow-caps?q=supply+cap#supply-caps

According to the docs, they've added supply caps to avoid certain exploits. The caps can be changed by admins.

Here is the dashboard for the token I was trying to supply (USDC). It seems that I was experimenting right on the edge of remaining supply before cap. Visual explanation from the AaveV3 dashboard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.