LoopStake
Last updated
Last updated
Loopstake refers to the strategy of amplifying yield earned from staking by leveraging liquid staking assets against the base asset, it can also be called Leveraged Staking. This approach allows users to potentially earn higher staking rewards than they would with just their own funds.
For example, in DOT leveraged Staking, vDOT is supplied, and DOT is borrowed. If a user sets a 2x leveraged position, it means that this user will receive 2x staking rewards from vDOT base on his/her principle.
Unlike other loan protocols, loops in Bifrost's leveraged Staking are enabled only for the exchange between relevant vTokens and their underlying Tokens (e.g., vDOT/DOT, vGLMR/GLMR, and not vDOT/GLMR). As a result, Bifrost's lending Market specializes in offering services for leveraged Staking of vTokens, but it does not offer the function of borrowing any Token for users. This approach guarantees a stable liquidity flow between vTokens and Tokens.
The leveraged Staking yield comes from three sources:
Exposure to the yield-bearing nature of Bifrost’s vTokens: vDOT, vGLMR, vASTR and others.
Usually, if lending supply is equal to borrowed liquidity, the borrowing Interest will be higher than the lending Interest. Therefore, users must establish a reasonable position based on real-time market conditions in order to maximize the leveraged Staking returns.
Based on lending Interest, lending and Borrowing Markets can be incentivized with BNC through governance. In certain scenarios, Lending and Borrowing Interests may reverse, with Lending Interest approaching Borrowing Interest or even exceeding it. This situation can lead to Leveraged Staking generating higher profits than the normal interest situation.
Here is a simple example to understand how leveraged staking can amplify yield from vDOT.
Assume User A has 1000 vDOT. The user deposits his vDOT for vDOT leveraged Staking, and sets a 4x leverage.
Now, let's say:
vDOT yield-bearing APY
18%
DOT borrowing rate
10%
Thus, user's position is:
User made a 1,000 vDOT deposit, with 4x leverage
Total DOT Exposure: 1,000* 1.2* 4 = 4,800 collateralized DOT
(Note: 1 vDOT equals to 1.2 DOT)
Total DOT Debt = Total Exposure - Initial Deposit = 4,800 - 1,200 = 3,600 DOT as debt
Loan To Value (LTV) : Debt / Collateral, LTV = 3,600 / 4,800= 75% LTV
vDOT APY = 18% : 4,800 * 18% = 864 DOT (Earned from staking APY)
Borrowing APY = 10% : 3,600 * 10% = 360 DOT (Paid as borrowing Interest)
Net DOT Earned = 864 - 360 = 504 DOT
Net APY = Net DOT Earned / Initial Deposit = 504 / 1,200 = 42%
The user simply needs to set the leverage in “one click” in order to open or close a position. The Bifrost Leveraged Staking module will borrow or repay funds in the lending Market through Flash Loans to meet the user's needs. The detailed process is as follows:
Each of the following processes is completed in a single atomic transaction, where the failure of any step will cause the entire transaction to fail. (For the sake of quick understanding of the workflow, the following examples do not consider LTV calculations.)
Let's say user A wishes to open a 4x Leveraged Staking position using 10 vDOT, with a vDOT:DOT exchange rate of 1:1.2.
The Leveraged Staking module first checks if the user can establish 4x leverage based on the current Loan-to-Value (LTV). If it exceeds the user's safe LTV, the transaction can't be executed.
If step 1 is successful, the Leveraged Staking module will issue all necessary DOTs for the 4x leverage in one go. So, it's 3101.2 = 36 DOT.
Convert 36 DOT into 30 vDOT.
Both the user's principal 10 vDOT and the 30 vDOT from the previous step are jointly mortgaged into the lending Market.
Borrow 36 DOT and destroy (Flash Loan logic: 36 DOT were issued at step 2, so here we need to burn it).
User A's current position becomes:
36 DOT
40 vDOT
Based on the position already established by User A above, let's suppose User A wants to deleverage all his positions.
The Leveraged Staking module issues the 36 DOT required for User A to repay his whole debt.
Repay the debt with 36 DOT.
Calculate the amount of vDOT needed to be withdrawn from the lending Market according to the the swap slippage, assuming the slippage is 0.1 vDOT.
Withdraw the user's collateral of 30.1 vDOT, and exchange 30.1 vDOT for 36 DOT in Bifrost Swap.
Destroy the 36 DOT (Flash Loan logic: 36 DOT were issued at step 1, so here we need to burn it.)
User A's current position becomes:
0
9.9 vDOT
Assuming user A wants to deleverage to 2x leverages position.
(*Since there is swap slippage in between the repayment process, the final result will be slightly smaller than the target leverage position)
The Leveraged Staking module issues 24 DOT.
Repay the debt with 24 DOT.
Calculate the amount of vDOT to be withdrawn from the lending Market according to the Swap slippage, assuming the slippage is 0.1 vDOT.
Withdraw 20.1 vDOT of user A's collateral and exchange 20.1 vDOT for 24 DOT in Bifrost Swap.
Destroy the 24 DOT.
User A's current position becomes:
12 DOT
19.9 vDOT
You may be wondering, after deducting the slippage, will User A's LTV trigger a liquidation?
In practice, the lending Market will judge whether the user's LTV will trigger a liquidation when the user is ready to withdraw collateral. If the answer is affirmative, then the transaction will not be able to be successfully executed.
In the 4th step of the above case, if the user's LTV has exceeded the liquidation mark when withdrawing 15.1 vDOT of collateral, then the whole process will fail. Therefore, in this situation, the user needs to manually add collateral to ensure the successful execution of the transaction.
In Bifrost Loop Stake, only loans between related tokens are supported, such as in the vDOT Loop Stake, only the operation of mortgaging vDOT to borrow DOT is supported. Since their relative prices on the market are relatively stable, when the price of DOT rises or falls, vDOT will also change synchronously.
In extreme market conditions, if the price of vDOT deviates significantly from DOT, since Loop Stake only accepts vDOT or vKSM as collateral, the LTV of all mortgagors may exceed the liquidation threshold, but they will still remain in position (no liquidation), just waiting for the price of vDOT to return to his expected ratio.
Depegging from exchange rate between vToken and Token
If systemic risks occur in the Bifrost protocol, or malicious governance actions leading to a malicious issuance of vToken, this may cause a drastic fluctuation in the exchange rate between vToken and Token (check Bifrost Financial Security for detailed statement), leading vToken system to crash.
However, compared to smart contracts, one of the characteristics of Bifrost as a Polkadot parachain is that it has Shared Security, therefore high security guarantees are ensured.
Oracle
An incorrect price feed can lead to a misalignment between the vToken's value and the underlying asset. This can lead to depegging, where the vToken loses its intended value correlation with the underlying asset, potentially causing cascading liquidations and loss of confidence in the market.
Bifrost uses the Oracle Module to obtain Token prices from 4 data sources, including DIA, Kraken, Coingecko and Gate. Bifrost will take the median of at least three of these data sources at given time intervals to calculate and post this result as the final on-chain price.