Leveraged Create & Close
DeFi Saver's signature use-case is our one-transaction solutions for managing positions in DeFi's leading lending protocols.
While we have a plethora of these advanced tools - let's look at one that helps you easily open a leveraged position, and one that lets you easily close it:
How the Leveraged Create tool works:
We'll first look at how you can open a leveraged position.
When you visit any of the protocols on DeFi Saver, you'll find the "Create" button:

Clicking on it will take you to a new dashboard, and the "Create" tab - so you'd want to switch over to the "Leverage" tab:

From here, you'll be able to:
Choose the collateral asset
Input the starting collateral amount
Choose the debt asset
Use the slide to set your leverage amount
Set your preferred exchange route (DeFi Saver automatically finds and set the best one)
Set your slippage limit
Once everything cecks out, click "Create".
And voila! This will open a leveraged position in a single transaction. This 1-tx looping is achieved in the following steps:
Your initial collateral is first supplied
A flash loan is used to borrow the full amount of debt that your leveraged position would generate
The debt is swapped to the collateral asset
The collateral asset is then supplied
The new, increased borrow power is used to borrow debt
This is then used to pay back the flash loan
How the Close tool works:
This tool lets you fully close your position in a single transaction, without you needing to have any funds in your main wallet.
When you visit the protocol that you have an open position on, you'll want to click on the "Close" button:

This will open a pop-up window:

Here, you'll be able to choose which asset you want to close to, as well as the slippage settings and exchange route.
The "Close (to X)" represents which asset will be withdrawn to your EOA wallet once the position is fully closed. To understand this in more detail, let's look at how the "Close" tool works in the background:
First, it flash loans the debt asset
It uses the flash loaned funds to pay back all of the debt
Now that your collateral is freed up, it's withdrawn
The collateral is then swapped to the debt asset
This is used to pay back the flash loan
The remaining funds are withdrawn to your EOA
Now, if you choose "Close to (collateral asset)", this means that it will only swap enough of your collateral to cover the flash loan, but it will withdraw the rest in the collateral token.
If you choose "Close to (debt asset)", it's going to swap all of your collateral to the debt asset, pay back the flash loan, and the rest will be withdrawn in the debt token.
These tools are available for all protocols for positions that are on a Smart Wallet. Depending on the protocol, they may also be available for EOA positions. To learn more about this availability - please refer to this article.
Both the Leveraged Create and Close tools have the standard variable DeFi Saver fee associated with them. This is because both are advanced tools that include a swap within them.
The fees are:
0.01% on stablecoin swaps
0.1% on swaps between assets that are correlated in price (e.g. wstETH -> ETH)
0.25% on swaps between assets that are not correlated in price
If your position uses Pendle PTs on Aave, there are no DeFi Saver fees associated with these tools
Last updated