# What is SuperStaker?

SuperStake your ETH to amplify your APR

{% hint style="info" %}
**TL/DR:** SuperStaker is a tool that supercharges your staking yields by supply your Lido Staked ETH as collateral on Aave and borrowing ETH against it to stake even more ETH. Even after the interest paid on the debt, you could more than double your staking APR.
{% endhint %}

## Getting Started

**Got 90 seconds?** Check out a video demo of SuperStaker:

{% embed url="<https://youtu.be/1KOah5Lce0s>" %}

{% content-ref url="/pages/U7fgH9EBTm63A4WYPsxu" %}
[Lido Staked Ether](/basics/lido-staked-ether)
{% endcontent-ref %}

{% content-ref url="/pages/JtVkdIas0P6KAMEuWImw" %}
[stETH on Aave](/basics/steth-on-aave)
{% endcontent-ref %}

{% content-ref url="/pages/IaaDAASqHmsRunb3OyJT" %}
[WETH Debt on Aave](/basics/weth-debt-on-aave)
{% endcontent-ref %}

{% content-ref url="/pages/8Tf2BjcfajQ46hODogsB" %}
[Risk](/basics/risk)
{% endcontent-ref %}


# Lido Staked Ether

> The Lido Ethereum Liquid Staking Protocol, built on Ethereum 2.0's Beacon chain, allows their users to earn staking rewards on the Beacon chain without locking Ether or maintaining staking infrastructure.
>
> Users can deposit Ether to the Lido smart contract and receive `stETH` tokens in return. The smart contract then stakes tokens with the DAO-picked node operators. Users' deposited funds are pooled by the DAO, node operators never have direct access to the users' assets.
>
> Unlike staked ether, the `stETH` token is free from the limitations associated with a lack of liquidity and can be transferred at any time.&#x20;
>
> (<https://docs.lido.fi/>)


# stETH on Aave

{% hint style="info" %}
**News Flash:** On May 19, 2022, the risk parameter for `stETH` as collateral on Aave v2 were changed to a maximum LTV of 69% and a Liquidation Threshold of 81%. [Details can be found here](https://app.aave.com/governance/proposal/75/).
{% endhint %}

The Aave v2 lending protocol supports Lido `stETH` as collateral (but you cannot borrow `stETH` on Aave).

Every token supported by Aave has specific risk parameters / limits when used as collateral:

* **Maximum LTV**. The maximum Loan-to-Value (LTV) ratio is the maximum that can borrowed against the collateral.  The current max LTV for `stETH` is `69%`. This means that you can borrow up to 69% of the value of your deposited `stETH` on Aave.
* **Liquidation Threshold**. The liquidation threshold is the LTV threshold past which your position can be liquidated. The current liquidation threshold for `stETH` is `81%`. This means that if the value of your `stETH` was to decline to the point that the value of your debt now comprised 81% or more of the value of your stETH collateral, then some of your `stETH` could be liquidated and used to pay down your debt. Given that stETH is pegged to the price of ETH, it would have to become significantly de-pegged for this to occur, see the section on [Risk](/basics/risk) for more.
* **Health Factor.** The Aave Health Factor is calculated as: `TVL / Liquidation Threshold`. As such, when it goes below `1.0`, you may be subject to liquidation.


# WETH Debt on Aave

You can borrow ETH on Aave in the form of WETH

Aave enabled you to borrow against your supplied (deposited) collateral. On Ethereum Mainnet, you can borrow `ETH` in the form of WETH (wrapped Ether). `WETH` is an ERC20 version of native `ETH` and *1 ETH is equal to 1 WETH*.

Using SuperStaker, you are borrowing `WETH` against `stETH` collateral, and using that `WETH` to stake more ETH, with the resulting `stETH` also deposited in Aave.


# Risk

Do your own research

{% hint style="info" %}
**Disclaimer:** Nothing in these docs is financial advice. But you knew that already. :wink:
{% endhint %}

Anytime you use leverage, there is risk.

The amount of risk can vary from minimal to crazy-degen, depending on *what* you are borrowing, *how much* you are borrowing, and *what you are buying* with the borrowed funds.

### No Risk Example

Suppose I borrow `1 USD` and use to buy `1 USD` ... which is the same thing as just holding onto it. If the value of USD decreased by 20%, my dollar is worth less. But my debt is denominated in dollars, so it has also decreased by the same amount. The dollar that I have can still be used to pay back 100% of the debt principal.

### Low Risk Example

A similar example, this time in crypto. Suppose I borrow `1 DAI` and use it to buy `1 USDC`. Both are pegged to `USD`, with reserves backing that value. So again, if `USD` value decreases by 20%, both my `USDC` and my `DAI` debt are likely to decrease in value by the same amount. My `1 USDC` can repay my `1 DAI` debt principal.

### De-pegging Risk

But what if, for some unforeseen reason, the market decides that `1 USDC` or `1 DAI` is worth something less than `1 USD`? Suppose in the previous example, the market price of `USDC` fell to `0.95 DAI`. Now it becomes insufficient to repay my DAI debt.

An extreme example of de-pegging risk was the collapse of the `UST` "stable" coin on the Terra blockchain, in May 2022. `UST` was not back by equivalent reserves but instead was back by algorithms and incentive mechanisms to maintain the peg to the `USD`. Long story short, UST lost its peg, triggering a "bank run" downward spiral until it became worthless. In-depth analyses and opinions can be found elsewhere, but it highlights the fact that mechanism maintaining a peg *matters*, whether by reserves, incentives, or other means.

### stETH Depegging Risk

Lido staked Ether (`stETH`) is pegged to the price of ETH. For every `1 ETH` that gets staked via Lido, `1 stETH` is minted. So on this basis, the peg is maintained by 1:1 reserves. However, `stETH` cannot currently be redeemed for `ETH`. The reason is that the ETH reserves are locked in the Beacon chain staking contract until the merge (or more accurate, the Ethereum update soon after the merge that will enable withdrawals). As such, the stETH peg is based on the promise that sometime in the future, you will be able to redeem `1 stETH` for `1 ETH`. In the meantime, rather than redeeming, you can *sell* your `sTETH` on the market and exchange it for `ETH`. There are multiple `ETH/stETH` liquid pools on Curve, Balancer, etc. to facilitate this, and the Lido DAO provides `LDO` governance tokens as incentives for providing liquidity to `stETH` in these pools.

Note that `stETH` rarely trades for exactly the same price as ETH, usually the `stETH` price is slightly less. Until recently, `stETH` traded for between 0.99 and 1.01 ETH, as show in the following chart.

![90 Day stETH price denominated in ETH](/files/k4e83DMjP1lXgIYfB7dr)

*What happened in mid-May 2022?* As mentioned above, the collapse of `UST` happened. And the market crashed. One theory is that *if UST can collapse, what about other pegged assets*? Speculation aside, the fact is that `stETH` lost its peg, at least temporarily, and has been trading in the range of `0.975` and `0.985 ETH` in recent days (today being May 22, 2022).

### Changes in Aave Risk Paramters for stETH

As a result of the de-pegging of stETH in May 2022, Aave governance voted to adjust the rsik parameters for `stETH` as collateral. [Details and rationale can be found in the proposal,](https://app.aave.com/governance/proposal/75/) but the changes were:

| Parameter             | Before May 17th | After May 17th |
| --------------------- | --------------- | -------------- |
| LTV                   | 73%             | 69%            |
| Liquidation Threshold | 75%             | 81%            |

Due to the increased risk, you can now only borrow 69% of the value of your supplied stETH, whereas before you could borrow up to 73%. Perhaps more notable is the new spread between max LTV and the new liquidation threshold of 81%. If you borrowed 69% today the value of your `stETH` would have to drop significantly before you became at risk of liquidation.

### How much would the stETH price need to fall to risk liquidation?

Today (May 22, 2022) the price of `stETH` in `ETH` is `0.976 ETH`. Suppose you SuperStaked 10 ETH at 69% target LTV. Here is a table with some scenarios that show the changes in LTV at different prices of `stETH` in `ETH` terms.

| StETH price (in ETH) | Value of stETH | Value of WETH Debt | LTV   |
| -------------------- | -------------- | ------------------ | ----- |
| 0.976                | 29.48          | 20.20              | 68.5% |
| 0.950                | 28.69          | 20.20              | 70.4% |
| 0.925                | 27.94          | 20.20              | 72.3% |
| 0.900                | 27.18          | 20.20              | 74.3% |
| 0.875                | 26.43          | 20.20              | 76.4% |
| 0.850                | 25.67          | 20.20              | 78.7% |
| 0.825                | 24.92          | 20.20              | 81.1% |

The above table shows that `stETH` would need to fall to 82.5% of the price of `ETH` before hitting the liquidation threshold. (For clarity, note that the above chart does not consider the stETH APR nor the interest on the debt, both of which depend on how much time has passed before reaching the `stETH` price in each scenario). Note that the lowest point during the aftermath of the `UST` crisis, sTETH briefly traded for `0.95 ETH` and has never traded below `0.937 ETH`.  You can make your own determination about the likelihood of the `stETH` price dropping to `0.825 ETH` but hopefully this chart provides some helpful context.

### The Merge

Another risk consideration relates to the Ethereum "merge", when the Ethereum migrates to Proof-of-Stake (PoS). Some predict this will happen in August 2022 and that a subsequent update to enable withdrawals of staked ETH by the end of 2022. But these dates are not guaranteed.

There are two key implications to consider:

* When withdrawals are enabled, holders of `stETH` will be able to redeem `1 stETH` for `1 ETH` from Lido protocol directly, and will not longer need to rely on liquidity pools and market prices. In theory, de-pegging risk is then reduced.
* After the merge, ETH stakers -- including holders of `stETH` -- will begin receiving a share of Ethereum transactions fees and MEV, in additional to ETH issuance. While this may not directly affect the risk, it will increase the rewards. How much? Speculation is left to the reader. :wink:


# Recursive Leverage?

Instead of using SuperStaker, you could achieve the same end result by manually doing recursive leverage. Here is an example of how that could be done, assume an initial deposit of `1 ETH`:

1. &#x20;Stake `1 ETH` via Lido and receive `1 stETH`.
2. Deposit `1 stETH` on Aave.
3. Borrow the maximum 69% LTV: \~`0.69 WETH`.
4. Withdraw (unwrap) the `WETH` to get `0.69 ETH`.
5. Stake `0.69 ETH` via Lido and receive an additional `0.69 stETH`.
6. Deposit the `0.69 stETH` on Aave.
7. Because you now have more collateral, you borrow more WETH against it. Borrow 69% of 0.69 = `~0.48 WETH`.
8. Withdraw (unwrap) the WETH, etc.

You can keep repeating the above to `recursively` borrow, stake, and deposit. It has to be done in these incremental steps because Aave requires deposited collateral in order for you to borrow more. Note that each of the above steps represents an Ethereum Mainnet transaction that costs gas. To do this once *you need to pay for 6 transactions*. To continue through 15 levels, it would require \~*60 transactions* ... and considerable time.

### SuperStaker does 15 levels in 2 transactions

SuperStaker effectively achieves the same thing as 15 levels of recursive leverage with only 2 transactions: one to approve the debt, and the other to do the rest.  If you already have stETH, then it takes 3 transactions, with an additional approval needed.  The SuperStaker magic :magic\_wand: is the use of Aave flash loans.

{% content-ref url="/pages/APgITdJ4OFXUVtIJXNU3" %}
[Aave Flash Loan](/how-it-works/aave-flash-loan)
{% endcontent-ref %}


# Stake with Lido

SuperStaker uses the Lido liquid staking protocol to stake ETH that you supply, plus ETH proceeds borrowed from Aave.

### Target LTV

In addition to the amount of ETH you want to stake, you also specify at target LTV (loan-to-value) ratio. The LTV determines how much will be borrowed on your behalf. The current maximum LTV for `stETH` on Aave is 69%.  The higher the LTV you choose, the lower your Aave Health Factor will be, and the higher your [risk](/basics/risk). The higher the LTV chosen, the higher your net APR will be.

After SuperStaking, you will have debt approximately equal to the LTV chosen. For example, if you choose 69%, then the Aave debt will be \~69% the value of the supplied (deposited) `stETH` in Aave.

The debt will be initiated via an Aave flash loan.

{% content-ref url="/pages/APgITdJ4OFXUVtIJXNU3" %}
[Aave Flash Loan](/how-it-works/aave-flash-loan)
{% endcontent-ref %}


# Aave Flash Loan

### Recursive Leverage Simulation

Rather than recursively leveraging by incrementally borrowing, staking, and depositing, the magic of SuperStaker simulates 15 levels of recursive leverage, and calculates the final amount of deposited `stETH` and `WETH` debt. This simulation happens in your browser, before any transactions are sent. Once the final loan amount is calculated, an Aave Flash Loan is trigger for the full amount.

### Flash Loan

{% hint style="info" %}
**What is a flash loan?** A flash loan is a loan that is usually repaid within the same transaction, and thus no collateral is required. Some types of flash loans -- as used by SuperStaker -- are not repaid at the end of the transaction, but rather incur debt as long as sufficient collateral is supplied before the end of the same transaction.
{% endhint %}

### Stake ETH with Lido

Once the requested `WETH` loan has been provided to SuperStaker, the WETH is unwrapped to native `ETH`. This `ETH` is then added to the `ETH` you sent initially and the combined amount is staked via LIDO, returning 1 `stETH` for each `ETH` staked.

### Deposit stETH with Aave

The final step is to deposit the stETH as collateral on Aave against the debt triggered by the flash loan.

### SuperStaker works on your Behalf

The above steps are taken on your behalf, and you can then go the Aave Dashboard and see both the supplied `stETH` and borrowed `WETH`.  The SuperStaker contract is designed to have Zero TVL.

{% content-ref url="/pages/xDMBVoHl4BdawwU2KflZ" %}
[Zero TVL](/how-it-works/zero-tvl)
{% endcontent-ref %}


# Zero TVL

SuperStaker holds no `ETH`, `stETH`, `WETH`, nor any debt. **Zero TVL**. This is by design.

At the end of your SuperStaker transaction, **you** have stETH supplied to Aave and **you** have debt provided by Aave. SuperStaker does not act a vault, as some protocols do. SuperStaker does not issue shares, you hold only Aave issued tokens. As such, *the SuperStaker contract does not hold funds that could be compromised by a malicious hacker*.

### How Zero TVL?

The first step is for you to "approve delegation", which means that you are giving SuperStaking the ability top incur debt on your behalf. That said, note that Aave will not let you incur debt if you are not also holding sufficient collateral. So you are basically saying: *If SuperStaker provides me with enough collateral, then SuperStaker can incur this specific amount of debt on my behalf*.

The final step that the SuperStaker transaction takes is to deposit the stETH collateral with Aave, to cover the debt. This deposit is sent to Aave on your behalf, meaning that Aave credits *your address* with the deposit and issues `aSTETH` tokens to you directly.


# Deployed Contract

SuperStaker is deployed on Ethereum Mainnet at:

`0xDA3231D0Ad3dd50C1B33c167DB27e6200f2C92D0`

{% embed url="<https://etherscan.io/address/0xda3231d0ad3dd50c1b33c167db27e6200f2c92d0>" %}
SuperStaker on Etherscan
{% endembed %}

Note that the contract is only 70 lines of Solidity code, not counting includes. :nerd:


# Roadmap

* Support hybrid scenarios where the user already some `stETH` supplied to Aave, or want to use both `ETH` and `stETH` as a starting point, etc.
* Support for eMode on Aave V3 .... just waiting for this to be launched on Ethereum Mainnet (hint, hint)
* Support for SuperStaking `stMATIC` on the Polygon network .... just waiting for `stMATIC` to be supported as collateral on Aave Polygon market
* Feature to unwind or rebalance based a new target LTV. (But maybe this feature isn't needed as Aave's "repay with collateral" feature may suffice here)
* Other? Ideas welcome: <https://twitter.com/super_staker>&#x20;


# Source Code

The source code for SuperStaker is located at:

{% embed url="<https://github.com/markcarey/superstaker>" %}
SuperStaker on GitHub
{% endembed %}

The subgraph is simple, providing a cumulative total of `stETH` staked via SuperStaker.


# Subgraph

The SuperStaker subgraph can be found at:

{% embed url="<https://thegraph.com/explorer/subgraph?id=FnzRRPgTa4rdSpDHmAkeYbTDoMf1YuA7FkoDTPTz1RC1&view=Overview>" %}
SuperStaker Subgraph
{% endembed %}

The subgraph is simple, providing a cumulative total of `stETH` staked via SuperStaker.


