protocol-v2 icon indicating copy to clipboard operation
protocol-v2 copied to clipboard

Add STETH to Aave V2

Open Psirex opened this issue 3 years ago • 0 comments

Lido's stETH represents the user’s staked ETH balance of the beacon chain along with staking rewards accrued or penalties inflicted on validators in the beacon chain.

Due to the rebasing nature of stETH, the proposed listing implementation involves few changes to AAVE’s generic aToken. The proposed aToken uses underlying stETH shares to store balances and implement the rebase ability. Thus, it has 2 private balances and 1 public balance.

  • The internal (fixed-supply) balance and total supply are used for book-keeping. The deposited balance is stored in stETH shares and converted into the amount of the tokens with functions from stETH. Users’ balances are book-kept with the underlying ERC20 token.
  • The internal (elastic-supply) balance and total supply correspond to the deposited balance without accrued interest. Rebasing of aSTETH according to stETH happens in this layer.
  • The external (elastic-supply) balance and total supply correspond to the deposited balance with interest. Externally, the aSTETH behaves similar to every other aToken. It always maintains a 1:1 peg with the underlying stETH.

The current implementation doesn’t support borrowing, neither with variable nor with stable interest rates. The stableDebtSTETH and variableDebtSTETH contracts extend default stableDebtToken and variableDebtToken contracts accordingly to make it impossible to use borrowing with aSTETH because default debt tokens are not compatible with the AStETH contract.

Implementation has been audited by MixBytes: https://github.com/lidofinance/audits/blob/main/MixBytes%20AAVE%20stETH%20integration%20Security%20Audit%20Report%2002-22.pdf

To deploy AStETH, VariableDebtStETH, StableDebtStETH, and DefaultReserveInterestRateStrategy used standalone deployment script https://github.com/lidofinance/aave-asteth-deployment .

Psirex avatar Jan 19 '22 16:01 Psirex