Product deep-dive #2: Leveraged Perpetual Trading — Capitalize on your market view with up to 88x leveraged trading!

Rockman Perp88
Perp88
Published in
7 min readNov 11, 2022

This article is the second part of the series that will provide a comprehensive look at Perp88 before its official launch on November 15th. Today, we will be covering another core features, leveraged perpetual trading. Below are the key topics that we will cover in this article:

  • Perp88's implementation of leveraged trading feature
  • Borrowing Fee & Funding fee calculation
  • Liquidation Process

Leveraged Perpetual Trading 📈:

Perp88 supports leveraged trading of assets in the PLP fund (MATIC, WETH, WBTC) Users can open a long or short position up to 88x of their collateral value, leveraging the liquidity in the PLP fund.

Profits from long positions are paid in the underlying assets of the position (e.g. a long MATIC position will receive profit in MATIC.) On the other hand, profits from short positions are paid in stablecoins. Users can specify which stablecoin they’d like to receive profit in (i.e., a short MATIC position will yield profits in USDC or USDT.)

Below, we walk through an example of what happens when a user opens a leveraged long BTC position:

  • A user deposits 20,000 USDC into the platform as collateral. The 20,000 USDC is then added into the PLP fund.

Note that the value of your collateral is taken as a snapshot when your collateral is deposited and will not change even if the price of the asset changes. For example, if you deposit 1 ETH when 1 ETH = $2,000 as your collateral, your collateral value will remain at $2,000 regardless of any subsequent price movement in ETH.

  • A user then opens a leveraged long position on BTC at 5x at 20,000 USDC per BTC. This means that the position size is 5 BTC.
  • 5 BTC from the PLP fund is reserved, meaning no one can withdraw or swap for this 5 BTC, to ensure the fund has enough assets to pay out as profits.
  • Depending on whether BTC price increases or decreases, the profit or loss from the position is removed/added to value of their collateral. In the case where the net loss of the position, inclusive of funding fee, exceeds the collateral value, the position is liquidated and the collateralized asset is taken by the platform.
  • When the user closes the position, they can withdraw their collateral and profits (if any) in the form of the asset that they long (BTC).

📉 Opening a Leveraged Short Position:

Below, we walk through an example of what happens when a user opens a leveraged short BTC position:

  • A user deposits 20,000 USDC into the platform as collateral. The 20,000 USDC is then added into the PLP fund.

Note that the value of your collateral is taken as a snapshot when your collateral is deposited and will not change even if the price of the asset changes. For example, if you deposit 1 ETH when 1 ETH = $2,000 as your collateral, your collateral value will remain at $2,000 regardless of any subsequent price movement in ETH.

  • A user opens a leveraged short position on BTC at 5x at 20,000 USDC per BTC. This means that the position size is 5 BTC.
  • 100,000 USDC (equivalent to 5 BTC at the time of position opening) from the PLP fund is reserved, meaning no one can withdraw or swap for this 100,000 USDC, to ensure the fund has enough assets to pay out as profits.
  • Depending on whether BTC price increases or decreases, the profit or loss from the position is removed/added to value of their collateral. In the case where the net loss of the position, inclusive of funding fee, exceeds the collateral value, the position is liquidated and the collateralized asset is taken by the platform.
  • When the user closes the position, they can withdraw their collateral and profits (if any) in the form of the a stablecoin (USDC/USDT).

Borrowing Rate Calculation 🏦:

Perp88 currently employs a single slope borrowing rate model. The Borrowing Rate on each asset is charged based on the asset’s utilization, where the Max Borrowing Rate is charged at 100% utilization and linearly decreases to 0% Borrowing Rate per hour when the utilization is at 0%. Borrowing Fee is charged on an hourly basis.

*Note that all assets share the same Borrowing Rate model

Dynamic Funding Rate

In the previous article, Product Deep-dive #1: PLP Fund, we shared that Perp88 will implement a Dynamic Funding Rate to help bring a balance between the long and the short OI on Perp88.

The dynamic funding rate is applied on top of the utilization-based Borrowing Rate. When long OIs are larger than short OIs, longs will pay shorts. Conversely, if short OIs are larger than long OIs, shorts will pay long. The larger the differences, the higher the rate. The exact Funding Rate can be calculated using the formulas shown below:

Long Positions:

Short Positions:

where Max Hourly Funding Rate is currently set at 0.0025%.

We have created this emulator to help you simulate the funding rate and the borrowing rate of your position. Please find the emulator here.

Liquidation Process 🌊:

The process of liquidation occurs when the losses of an open leveraged position exceeds the liquidation threshold (i.e. the loss of a position reaches the Collateral value multiplied by the Collateral Factor). To understand how liquidation is executed, please familiarize yourself with the following terms and parameters first:

The process of liquidation occurs when the losses of an open leveraged position exceeds the liquidation threshold (i.e. the loss of a position reaches the Collateral value multiplied by the Collateral Factor). To understand how liquidation is executed, please familiarize yourself with the following terms and parameters first:

  • Collateral value: Asset that a user puts up in order to open a leveraged long/short position.
  • Collateral Factor: This parameter determines the liquidation threshold. A position will be subject to liquidation if its losses reaches the Collateral Factor * Collateral Value at the time of deposit - Funding Fees. The Collateral Factor at Perp88 is currently set at 0.99.
  • Position Value: This is the value of your position. You can calculate this by multiplying the assets in your position with the asset price. For example, if you open a 5x BTC long at $20,000 per BTC, your position value is $100,000.
  • Profit & Loss (PnL): This is the profit or loss accrued to the position. You can calculate the PnL with the following formula: PnL = Current Position Value - Position Value at Opening. If the position is currently at loss, the PnL will be negative. If the position is currently in profit, the PnL will be positive.
  • Liquidation Buffer: This is the buffer that protects the position from liquidation. The Liquidation Buffer is calculated by the following formula: Liquidation Buffer = Collateral Value at Deposit * Collateral Factor. Once the Liquidation Buffer + Position PnL <= 0, the position will run the risk of being liquidated.
  • Liquidation Price: If the longed/shorted asset reaches this price, liquidation can happen. It is calculated by using the following formula: Liquidation Price = Asset Price at Position Opening + (if short) or - (if long) (Liquidation Buffer - Funding Fee) / Position Size at Position Opening * Asset Price at Position Opening).

Below, we share an example of how liquidation is carried out at Perp88.

Assumptions:

  • Bob deposits 20,000 USDC as collateral
  • Bob opens a leveraged long position on BTC at 5x when BTC is $20,000

At the time of position opening, here are some statistics on Bob’s position:

  • Collateral Value: 20,000 USDC or $20,000
  • BTC price at Opening: $20,000
  • Position Size at Opening: 5 BTC or $100,000
  • Current Position Size: 5 BTC or $100,000
  • PnL = $100,000 — $100,000 = $0
  • Collateral Factor: 0.99
  • Liquidation Buffer: $20,000 * 0.99 = $19,800
  • Liquidation Price: $16,040
  • $20,000 — (($20,000*0.99)/$100,000) * $20,000
  • $20,000 — (0.198 * $20,000)
  • $20,000 — $3,960
  • $16,040

Two weeks later, BTC price dropped to $16,040. Below are the statistics of Bob’s position at that point in time.

  • Collateral Value: 20,000 USDC or $20,000
  • Current BTC price: $16,040
  • Position Size at Opening: 5 BTC or $100,000
  • Current Position Size: 5 BTC or (5*$16,040) = $80,200
  • PnL: $80,200 — $100,000 = -$19,800
  • Collateral Factor: 0.99
  • Liquidation Buffer: $20,000 * 0.99 = $19,800

Since the loss of the position has now reached the Liquidation Buffer (i.e. $19,800 — $19,800 < or = 0), the position is now subject to liquidation.

  • Collateral Value: 20,000 USDC or $20,000
  • PnL: $80,200 — $100,000 = -$19,800
  • Remaining Collateral: $20,000 — $19,800 = $200

Once the position is liquidated, Bob will receive $200 (in the asset that he longs: BTC) from his remaining collateral value.

Closing Remarks 🙇🏻‍♂️:

The next article will focus on our referral program. Our referral program is one of the most, if not the most, generous referral program with up to 52% of fees distributed back to the program participants! Please stay tuned for more details.

Official Links:

Please find below the official links of Perp88:

WebsiteTwitterTelegramTelegram AnnouncementMedium DiscordGithub

--

--

Rockman Perp88
Perp88
Editor for

Strategy @ Perp88 — The premier decentralized perpetual exchange with the best economics on Polygon