LoopStake

What is LoopStake?

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.

Where does the yield come from?

The leveraged Staking yield comes from three sources:

1. Staking Yield

Exposure to the yield-bearing nature of Bifrost’s vTokens: vDOT, vGLMR, vASTR and others.

2. Lending Interest

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.

3. Protocol Reward

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.

Leveraged Yield Example

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/DOT exchange rate1 : 1.2

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%

How does it work?

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.)

Open position process

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.

  1. 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.

  2. 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.

  3. Convert 36 DOT into 30 vDOT.

  4. Both the user's principal 10 vDOT and the 30 vDOT from the previous step are jointly mortgaged into the lending Market.

  5. 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:

DebtCollateral

36 DOT

40 vDOT

Close position process

Based on the position already established by User A above, let's suppose User A wants to deleverage all his positions.

  1. The Leveraged Staking module issues the 36 DOT required for User A to repay his whole debt.

  2. Repay the debt with 36 DOT.

  3. 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.

  4. Withdraw the user's collateral of 30.1 vDOT, and exchange 30.1 vDOT for 36 DOT in Bifrost Swap.

  5. 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:

DebtCollateral

0

9.9 vDOT

Deleveraging Process

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

  1. The Leveraged Staking module issues 24 DOT.

  2. Repay the debt with 24 DOT.

  3. Calculate the amount of vDOT to be withdrawn from the lending Market according to the Swap slippage, assuming the slippage is 0.1 vDOT.

  4. Withdraw 20.1 vDOT of user A's collateral and exchange 20.1 vDOT for 24 DOT in Bifrost Swap.

  5. Destroy the 24 DOT.

User A's current position becomes:

DebtDeposit

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.

Risks

Liquidation

No Liquidation Risk

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.

Depeg Risk

  1. 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.

  1. 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.

Audit

Last updated