Blog.

AAVE Simulation Series: stETH:ETH Depeg (Pt. 0)

Cover Image for AAVE Simulation Series: stETH:ETH Depeg (Pt. 0)
Omer Goldberg
Omer Goldberg

Overview

AAVE is a pioneer in decentralized borrowing and a proper blue-chip DeFi protocol. As one of the most prominent borrowing protocols in the world, currently managing over 10 billion USD, robust risk management applications are required to empower users and developers with reliable, accurate data. This series aims to model, quantify, and asses different AAVE risk scenarios via agent- and scenario-based simulations. We'll focus on the doomsday scenarios that are top of mind for the AAVE community. After speaking with the AAVE risk team, we've decided to prioritize a stETH

depeg simulation. This has been a hot topic over recent months and is especially relevant with the upcoming Ethereum merge.

Simulation Overview

stETH
Depeg

stETH is one of the most popular assets provided as collateral on AAVE. A common stETH strategy is to initiate recursive borrow positions with ETH in order to maximize yields. The following illustration visualizes the flow.

Leveraged Flow

Looking ahead at the Merge there is uncertainty around the floor of PoWETH, which may prove to be a sustainable fork maintained by some of the current Ethereum miners. This has driven many investors to hold more ETH to qualify for ETH and PoWETH post merge. Because stETH cannot be unstaked before the merge, the only ways for stETH holders to move back to ETH are to exchange it on Curve, where liquidity is limited, or borrow against it for additional ETH. Currently, stETH is one of the most dominant collateral assets on AAVE (together with USDC).

AAVE Deposit Distribution

The most popular strategy with stETH collateral is borrowing ETH (as mentioned above).

We’ve used the Chaos Labs platform to model a stETH

price depeg, triggering cascading liquidations on AAVE in parallel with a stETH sell-off on Curve. We’ll quantify the required liquidity to initiate a liquidation spiral. Additionally, we’ll track bad debt accrued by AAVE.

Why This is Interesting

  1. AAVE’s stETH exposure
    1. stETH represents over 20% of asset value locked in AAVE. It is the largest exposure (aside from USDC) of AAVE collateral.
  2. The buzz around the Merge
    1. The upcoming merge has LIDO and stETH in the spotlight. Any compromise of LIDO (or FUD) may cause a stETH sell-off, which can trigger a depeg.
  3. stETH is primarily on-chain
    1. Unlike most major crypto assets, where significant liquidity is found on CeFi venues, stETH liquidity is mainly provided on Curve. This allows us to simulate inter-protocol dependencies and effects with minimal offchain assumptions, accelerating cascading liquidations.ion

Simulation Flow

stETH depeg flow

  1. Chaos Agent initiates the liquidation spiral by executing a 90K stETH swap on Curve. This pushes the stETH
    price to 0.72.
  2. Chaos Scenario modules propagate new prices to AAVE oracles. Updated prices drive updated health scores. Highly leveraged stETH whales become ripe for liquidations.
  3. Chaos Agents liquidate underwater positions and proceed to immediately realize profit by selling discounted collateral on Curve.
  4. stETH
    prices continue to decrease, triggering further liquidations.
  5. The death spiral continues until liquidity is thin and slippage is high. Liquidations are no longer profitable.
  6. AAVE is stuck with bad debt.

The Setup

Setup

  • Fork Mainnet from block 15006921 (any block can be specified here)
  • Agents:
    1. Liquidator - Monitors user's accounts health and executes liquidations when the health score is less than 1.
    2. Borrowers - Top 50 stETH suppliers - ETH borrowers with health Factor < 1.4
      1. The top 50 wallets cover 20% of provided stETH collateral on AAVE.
    3. stETH Seller - Dumps stETH into Curve to initialize de-peg
      1. Specifically, 90K stETH over a period of 30 blocks, such that 1 stETH = 0.775 ETH
    4. Oracle - We configure the AAVE price oracle to be a contract deployed by the Chaos platform. Subsequently, the simulation engine modifies the return value of the stETH price oracle based on Curve liquidity.
  • No additional AAVE risk parameter configurations. We use the risk parameters (collateral factors, etc) as set at the time of the fork.
  • The simulation runs for a period of 150 blocks.
  • All parameters addressed above, as well as agent instances and business logic, can be easily configured using the platform:

Edit Simulation

Results

We use Chaos Observables and Metrics to monitor the simulation and analyze results:

stETH Price Observer - Value Liquidated:

  • We show the exchange rate of stETH
    based on Curve Pool liquidity over the course of the simulation.
  • New prices are propagated to the AAVE oracle contract.
  • The update price oracles triggers updated health scores for the wallets. The price drop renders some of the wallets under-collateralized and eligible for liquidatons.
  • We show the amount of stETH liquidated by the Chaos Liquidator over the same plot. We see liquidations start at iteration 32 after stETH/ETH exchange rate drops to 0.775.
  • The total amount liquidated was 97K of stETH.

stETH Liquidations

Liquidity On Curve Pool Observer:

  • The quantity of ETH drops as liquidators are swapping stETH for ETH in the Curve pool.
  • We show the amount of liquidity over the course of the simulation. As the stETH quantity increases, its value drops due to the price curve.

Curve Liquidity by Eth Value

Liquidator Profit - Bad Debt:

  • We see liquidations starting on iteration 32, as the first accounts health factor goes below 1.
  • As liquidity on Curve is drained and slippage increases, it becomes less profitable to execute liquidations.
  • On iteration 95 (fig #3) it is no longer profitable to perform a liquidation.
  • When liquidations are no longer profitable, AAVE starts to accrue bad debt.
  • In total, we can observe ~100K ETH (fig #4) of bad debt.

Liquiditor Profit

AAVE Bad Debt

Health:

  • We can drill down and view in detail the health of each individual borrower over time to trace back events. (fig #5)
  • We are able to see when an account gets liquidated, its own health goes up, but driving other accounts’ health down as the liquidation impacts the price.

Borrower's Health

We can also view every transaction on the Chaos Block explorer, to follow accounts/liquidation details.

Latest Transaction

txExplorer

Assumptions, Disclaimers, and Further work

The number of accounts:

  • We use a sample of top 50 stETH
    borrowers with an initial health factor of 1.4.
  • The top 50 wallets cover 20% of stETH collateral on AAVE.
  • For more accuracy, we can run simulations that provide better coverage.

Asset Correlation:

  • In this simulation, we ignore the effect of stETH de-peg on other asset prices.
  • We also assume that other assets that can be liquidated during the simulation will have a negligible price impact due to high CeFi liquidity.
  • In future work, we will address on-chain liquidations using flash loans vs whales that can also sell seized collateral on CeFi markets.

stETH buying pressure - Arbs:

  • We do not simulate any stETH buy pressure on Curve in order to speed up the cascading liquidation effect.
  • A better model would have agents with different strategies, who may buy stETH for a premium and push the peg up.

Parameters:

  • We have used the liquidation threshold and liquidation bonus of stETH values of 80% and 7.5%.
  • In further work, we will show how to utilize the platform to examine risk parameter changes.

What's next? ⏭️

This simulation is a great starting point for modeling more complex scenarios for AAVE. We look forward to contributing value to AAVE users and the community at large 👻

In the meantime, we invite the community to reach out if they have questions or simulation requests.