Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Aave V3 upgrade 3.0.1 #260

Open
pedrovalido opened this issue Jan 19, 2023 · 3 comments · May be fixed by #274
Open

Check Aave V3 upgrade 3.0.1 #260

pedrovalido opened this issue Jan 19, 2023 · 3 comments · May be fixed by #274
Assignees

Comments

@pedrovalido
Copy link
Contributor

pedrovalido commented Jan 19, 2023

Aave has updated to 3.0.1. Link to Aave's PR is here aave/aave-v3-core#701
This PR has to be checked to see if the changes will have impact in Fuji's integration

@pedrovalido pedrovalido self-assigned this Jan 19, 2023
@pedrovalido pedrovalido changed the title Check Aave V3 upgrade Check Aave V3 upgrade 3.0.1 Jan 19, 2023
@pedrovalido
Copy link
Contributor Author

pedrovalido commented Jan 19, 2023

Interfaces we are using :

  • IFlashloanSimpleReceiver (Only changed "indentation" on comments)
  • IV3Pool

On IV3Pool, the function getReserveData(address asset) we are using has an added comment (WARNING) regarding this function's utility

    * @dev WARNING: This function is intended to be used primarily by the protocol itself to get a
    * "dynamic" variable index based on time, current stored index and virtual rate at the current
    * moment (approx. a borrower would get if opening a position). This means that is always used in
    * combination with variable debt supply/balances.
    * If using this function externally, consider that is possible to have an increasing normalized
    * variable debt that is not equivalent to how the variable debt index would be updated in storage
    * (e.g. only updates with non-zero variable debt supply)

They've also added a new function

   /**
    * @notice Returns the user data in a reserve
    * @param asset The address of the underlying asset of the reserve
    * @param user The address of the user
    * @return currentATokenBalance The current AToken balance of the user
    * @return currentStableDebt The current stable debt of the user
    * @return currentVariableDebt The current variable debt of the user
    * @return principalStableDebt The principal stable debt of the user
    * @return scaledVariableDebt The scaled variable debt of the user
    * @return stableBorrowRate The stable borrow rate of the user
    * @return liquidityRate The liquidity rate of the reserve
    * @return stableRateLastUpdated The timestamp of the last update of the user stable rate
    * @return usageAsCollateralEnabled True if the user is using the asset as collateral, false
    *         otherwise
    */
   function getUserReserveData(address asset, address user)
     external
     view
     returns (
       uint256 currentATokenBalance,
       uint256 currentStableDebt,
       uint256 currentVariableDebt,
       uint256 principalStableDebt,
       uint256 scaledVariableDebt,
       uint256 stableBorrowRate,
       uint256 liquidityRate,
       uint40 stableRateLastUpdated,
       bool usageAsCollateralEnabled
     );

which will probably be beneficial for us to use of the user specific deposit and borrow balance (instead of using the getReserveData that is how it is being done currently)

Image

On another topic, some changes on the IV3Pool may also apply to the flasherAaveV3

/**
    * @notice Returns whether the reserve has FlashLoans enabled or disabled
    * @param asset The address of the underlying asset of the reserve
    * @return True if FlashLoans are enabled, false otherwise
    */
   function getFlashLoanEnabled(address asset) external view returns (bool);

This is a function that returns true/false wether the flashloan for a given asset is currently enabled or not which might be useful to check when choosing the flasher who will rebalance a position

@pedrovalido
Copy link
Contributor Author

Also asked on Aave telegram if they have a defined date on the upgrade to 3.0.1 and it was a bit unclear when they're going to do so

Image

@pedrovalido pedrovalido linked a pull request Jan 31, 2023 that will close this issue
@pedrovalido
Copy link
Contributor Author

While running some tests noticed the tests that were passing before, are now failing due to reason 51
Note to self: check the docs on whats new - https://docs.aave.com/developers/whats-new/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant