Here is a scenario I am simulating on a Hardhat Avalanche Mainnet fork:
- Supply USDC to AaveV3.
- Borrow WAVAX.
- Wait four weeks.
- Claim WAVAX rewards.
- Swap the rewards into USDC via a UniswapV2-like pair.
- 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.