### What is a Perpetual Swap Rate?

A Perpetual Swap Rate is a type of derivative product that has no effective settlement date. Perpetuals settle at regular intervals and are then are reinstated, continuing in perpetuity until the customer decides to close the trade or a liquidation event happens.

There are many advantages when it comes to using Perpetuals over traditional markets. The main advantages are the following:

- There are no funding fees or interest payments. There is, however, a "swap rate" which is used to balance the ratio of longs and shorts. Depending on market conditions, sellers pay buyers 'contract notional' times 'swap rate' or vice versa. Therefore in some cases, holders of a contract could be earning fees simply by holding the contract.
- An improved liquidation mechanism that depends on an index, not a single spot price or single order book. This adds another degree of trading protection. An index price is an average price derived from up to different sources. On Liquid, the index price is derived from 5 different spot prices coming from trustworthy exchanges, including Liquid. The advantage here is that the impact of a sudden price swing in one spot exchange should be much less severe.

This article describes the** Swap Rate** process in perpetuals.

## Terms & Definitions

**Swap:** a mechanism that ensures convergence of the Perpetual price to the Index price by an exchange of currency swaps between long and short users

**Swap Interval:** the interval between 2 consecutive swap events

**Swap Rate:** rate used to compute the number of currency swaps exchanged. If the rate is positive, longs pay shorts; if the rate is negative, shorts pay longs.

**Index Price:** the price of the underlying instrument

**Mark Price**: price used for the mark to market and derived from the actual price of the Perpetual

## Overview

Swaps accumulate every second, but settlement occurs only every **8 hours at 0:00 UTC, 8:00 UTC, and 16:00 UTC. Or when a user closes their position, whichever comes first.**

Upon settlement, the accumulated currency swaps and unrealized P&L are adjusted in the users available balance (For isolated margin they will be reflected in the position itself to isolate the gains or losses)

**The calculated amount of currency swaps for each user with open positions:**

`Swap Amount = Position Size * Swap Rate * Time Fraction`

This mechanism ensures that the perpetual price is “tethered” to the index price. This is done by exchanging currency swaps between long and short users.

At every swap interval, the system computes the swap rate which is t**he difference between** the mark price and index price. This calculation will result in one of two outcomes:

- If the mark price is higher than the index price, then the swap rate is positive and longs pay shorts. This makes long positions less attractive and helps to push the perpetual price down toward the index
- If the mark price is lower than the index price, then the swap rate is negative and shorts pay longs, which helps to push the perpetual price up.

Your position value is irrespective of leverage. For example, if you hold 100 P-BTCUSD contracts, swap rate is charged/received on the notional value of those contracts, and is not based on how much margin you have assigned to the position.

*IMPORTANT: **Once settlement is complete all PnL will be realized and the opening price of all perpetual positions will be updated to the current Mark price.*

## Swap Formula

The swap interval is every second.

**The calculation should be carried out as follows:**

**Calculation of the Mark Price:**

The Fair Price is defined as the mid-price of the Perpetual at 1 P-BTC volume (that is the average of volume-weighted prices to buy 1 P-BTC and to sell 1 P-BTC ).

The volume used to compute the Fair Price should be configurable.

**The Mark Price is equal to the Index Price plus the 15-second EMA of the Fair Price minus Index Price:**

- Mark Price = Index Price + EMA(Fair Price - Index Price)

**Formula for the N-second EMA S(n) of a variable Y(n) is:**

- S(n) = a Y(n) + (1 - a) S(n-1) with a = 2 / (N + 1)

**Calculation of the Swap Rate:**

The Swap Rate is composed of 2 components: the Premium Rate and the Differential Interest Rate.

**We calculate first the Mark to Index Spread:**

- Mark to Index Spread = (Mark Price - Index) / Index

**We calculate then the Premium Rate as:**

**Formula to compute the Premium Rate is:**

- Premium Rate = Max (0.05%, Mark to Index Spread) + Min (-0.05%, Mark to Index Spread)

**The second component, the Differential Interest Rate is equal to the interest rate to borrow the quote currency (JPY) minus the interest rate to borrow the base currency (BTC):**

- Differential Interest Rate = Interest Rate (JPY) - Interest Rate (BTC)

The Differential Interest Rate will be set manually. This may be changed in a second phase to set its value in real time.

**The Swap Rate is the sum of the Premium Rate plus the Differential Interest Rate:**

- Swap Rate = Premium Rate + Differential Interest Rate

**Calculation of the Swap Amount:**

The Swap Amount is calculated as the product of the Position Size (in BTC) times the Mark Price (to convert to JPY) times the Swap Rate times the Time Fraction (time interval for the specific amount).

- Swap Amount (in JPY) = Position Size x Mark Price x Swap Rate x Time Fraction

**Note:** that the Position Size in BTC is used and not the Margin amount.

**Data availability:**

The Mark Price, the Differential Interest Rate and the Swap Rate is available to traders, both as a feed through the API.

## Swap rate example

Let's assume that User A opens a Long position by buying 10 BTC worth of the Perpetual contract with leverage 100 at a price of 999,450 JPY.

The counter-party of this trade is User B who sells 10 BTC worth of the Perpetual at 999,450 JPY.

During the first interval of 1 second, the Index Price is 1,000,000 JPY and the Perpetual Mark Price is 999,400 JPY. Moreover, the BTCJPY Differential Interest Rate is 0.005%.

**Calculation of the Swap Rate is as follows:**

- Mark to Index Spread (MIS)

MIS = (Mark Price - Index) / Index = (999,400 - 1,000,000) / 1,000,000 = - 0.06%

- Premium Rate (PR)

PR = Max(0.05%, MIS) + Min(-0.05%, MIS) = Max(0.05, -0.06) + Min(-0.05, -0.06) = 0.05 - 0.06 = -0.01%

- Swap Rate (FR)

FR = PR + Differential Interest Rate = -0.01% + 0.005% = -0.005%

Since the Swap Rate is negative, short (user B) pays to long (user A).

- Swap Amount exchanged between users A and B:

FSA (in JPY) = Position Size x Mark Price x Swap Rate x Time Fraction

= 10 BTC x 999,400 x (-0.005%) x (1 sec / 24 / 3600) = - 0.00578 JPY

Amount is negative, therefore shorts pay longs: - 0.00578 JPY is deducted from margin balance of user B, and the same amount is added to the margin balance of user A.

However, since this has not been settled yet, user A cannot withdraw this amount nor use it.

Have questions about Perpetual Contracts and trading? Contact our **Customer Support team now. **

**Recommended Articles**

What is Liquid Perpetual?

What are the fees for Liquid Perpetual?

What are the liquidation for Liquid Perpetual?

What are the difference between Mark and Index price?