> For the complete documentation index, see [llms.txt](https://docs.superstaker.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.superstaker.xyz/how-it-works/aave-flash-loan.md).

# 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.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.superstaker.xyz/how-it-works/aave-flash-loan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
