How can we help?

BitMart Futures V2.0 Liquidation and Margin Breach Liquidation Explanation

I. Liquidation Concept

Liquidation occurs when the margin balance falls below the maintenance margin. The margin balance refers to the sum of wallet balance and unrealized profit and loss, while the maintenance margin is the minimum margin amount that users must maintain to avoid liquidation of their contract positions.

II. Liquidation Price and Bankruptcy Price (the difference between Liquidation Price and Bankruptcy Price is the Maintenance Margin)

The liquidation price is the price at which a position triggers forced liquidation. This threshold is influenced by multiple factors, including the leverage used, maintenance margin rate, current price of the cryptocurrency, and the user's account balance.

The bankruptcy price refers to the amount lost by the user, which equals the value of the collateral deposited or the price at the time of initial margin. From this price onwards, the margin balance of the user being liquidated will be zeroed.

A diagram of a price

Description automatically generated

As shown above, a position has both bankruptcy price and liquidation price. The difference between them is MM (maintenance margin surplus). When the price falls below the liquidation price, the user loses control of the position. The system initiates the liquidation process and takes over the user's position. At this point, the system internally proceeds with the liquidation process.

III. Liquidation Process

The liquidation process consists of two steps, called " Forced liquidation" and "ADL" (Auto-Deleveraging). Regardless of the step, users lose the value of their positions once liquidation is triggered. In other words, upon liquidation trigger, users immediately incur losses equivalent to all the position margin (PositionIm).

  1. Forced liquidation: When the system takes over the user's position, it places a liquidation order at the bankruptcy price on the market. If the order is executed at a price better than the market price, the remaining amount from the position goes into the risk fund. For the user, this amount is referred to as the liquidation fee.
  2. ADL (Auto-Deleveraging): When the system places orders to sell at the bankruptcy price in the market, but the market conditions deteriorate rapidly, making it impossible to execute the orders. After the orders exceed 9 seconds, they are executed against quantified accounts at the bankruptcy price.

A diagram of a price

Description automatically generated

 

IV. Example

Forced Liquidation 

Using 5x leverage in isolated margin mode, a long position in ETC/USDT is established. The entry price is 22, and the position size is 10 ETC, as shown in the following image.

?code=OTc2OGQ5NzE3MTYyZWZlNjUwODFiYjlmZWI0YmFjNjBfWHIzYnZHUW90VHNvSk04UG1PRFVEMm83bGprN3NPQjNfVG9rZW46TkppTWJkdGxPbzBEUlN4ZHpJbHVoZTQwc3llXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

Liquidation Price Formula:

For a long position in a USDT-based contract, the liquidation price is rounded up to the nearest unit based on the price unit, with an ETCPriceUnit of 2. 

pv -(im+ab)+mm + takerFee (fee calculated at liquidation price)=resValue

Formula derivation: 

𝑙𝑖𝑞_𝑝𝑟𝑖𝑐𝑒= (pv - (im+ab) + mm)/(hv * cs *(1-takerRate))

Substituting the values into the formula:

?code=NjU0YTdiZTI4ODc3ZmEyMzBiZmUwYjdkZTVmZGM1NzJfOTk3a2ZQUjlFTzJSZUFVVEVwT21LS3gxZ2J5ZG8ybDFfVG9rZW46T2lkcWIxRGs2b0VJa2R4NDRoaHVEY1dlc1lmXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

The calculated result matches the current position result. 

When the mark price falls below 17.71, liquidation is triggered. At this point, the system takes control of the user's position and places a sell order at a price of 17.6. Based on the current order book, it can be observed that it will match with the buy order at position 21 on the order book. Therefore, the execution price of the liquidation sell order will be 21.

?code=OWI0YmZhZmE2OTRiYWViMDMwMWEwNWI2NzU1YWQzMDVfQ1RrSW9DOEJRYUtGakFqeVJOS05ERjJES1RDTHBxVFBfVG9rZW46U0JGdmI4UnQxb2VPWlZ4THhrZXVRTTBCc05oXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

The funds flow is as follows:

For the entire position, with an entry price of 22 and an exit price of 21, the realized P&L is: Realized P&L = (22 - 21) * 10 = 10 (loss)

The closing trading fee is calculated as: 

Closing trading fee = 21 * 10 * 0.0006 = 0.126

The liquidation settlement fee is: 

Liquidation settlement fee = positionIm - Realized P&L - Closing transaction fee Liquidation settlement fee = 44.132 - 0.126 - 10 = 34.006

?code=ZGY4ZjVhMTFmMzBjNDM5NTBiNmQyZmZiYzU0NjMzNDBfd2UyYjJFOVg4dms3U3k0M3FBdUFFNGFpeFdnZ2hSNWRfVG9rZW46SUpvT2IzQ1pSb1BNRHN4YjZBOHV5OTJtc0doXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

Trading History

Realized P&L from closing position = -(22 - 21) * 10 = -10 (loss)

Trading fee = 21 * 10 * 0.0006 = 0.126

?code=ZjdjODFlY2QxNzQwNjhlYjRmNjM5NzE1OGM1YTU4OGJfbWlDN0VhdUZIOTdLNW1lc2gxU0M1eEVEQmdFNEV2dTBfVG9rZW46VjkxMmJsZ1lrb09OWDN4dVRRN3V1dDlpc3pjXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

Position History:

Trading Fee = Opening Fee + Closing Fee

Opening Fee = 22 * 10 * 0.0006 = 0.132

Closing Fee = 21 * 10 * 0.0006 = 0.126

Total Fee = 0.132 + 0.126 = 0.258

Liquidation Fee as mentioned above = 34.006

Realized P&L from closing position as mentioned above = 10

?code=ZGJmZTM5M2VlNTA4OWY4NTVmYTJiNzJjZGFjYjFjY2FfU05Zb2Q2MFFvampMYXFoSnZ2U2ZGd3d0UTFyNTh6VXdfVG9rZW46WGUwd2JBc2hPb1l5cm94cmN2WXVPRXhZc2pjXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

Order History:

Order type: Liquidation Order

Realized P&L: 10

Liquidation Fee: 34.006

Closing Fee: 0.126 (Taker role)

?code=NTAxNjM0ZGQ1MWI5MjM2Yjg5ODY4MWY0ZTFjYzE1N2ZfeEhPS3VDNUFYV1g2Qm9GN2xESG5KbmlnYUR5VjJ6YzRfVG9rZW46SXc4V2JMbXB2b21YOEx4TW96WHVkM1c2c2FmXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

ADL

Using 5X leverage for isolated short position, forming a position, with an entry price of 21 and a position size of 10 ETC, as shown in the diagram.

?code=ZTBmMjE3N2ExZjgyZWQyNWM1M2Q4MWMyN2JkNjFkMDhfQzQzRnJ5UHpJaUZYQ3FIYVhDTjlKa1M5eTR4aWlUd2tfVG9rZW46U3N4U2JlY2R4b1NZOGN4UnhITXU1RTdqc0xoXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

For inverse contract short positions, the liquidation price is rounded down based on advancing one unit in priceUnit.

After derivation:

𝑙𝑖𝑞_𝑝𝑟𝑖𝑐𝑒 = (PV+IM+ab -MM)/((1+takerRate)*hv*cs)

Substituting the values into the formula:

?code=MjM4YWIzZWY4YTZiYTI3YWNlYmYwNTBlNmZhNmI2MGZfZGNTUlBSMkRzdHlqdktIdVJaV0RmSTRHZktFRXpmWG5fVG9rZW46UkxlTGJkSHRYbzg5QmZ4ek8ydnV3Vm11c0xoXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

For inverse contract short position, the liquidation price is rounded down based on advancing one unit in priceUnit.

PV + (IM + ab - MM - takerFee (fee calculated at liquidation price)) = resValue

After derivation:

liquidation_price = (PV + IM + ab - MM) / ((1 + takerRate) * hv * cs)

Calculating with the formula:

The calculation result is consistent with the current position result.

When the mark price falls below 25.09, triggering liquidation, the system will take over the user's position and sell it at a price of 25.2. Based on the current order book, it can be observed that there are no matching orders, and ultimately, the transaction will be settled with the quantified account at the price of 25.2, forming a forced liquidation.

i. When the liquidation starts, orders are placed at a price of 25.2. After no matches in the order book, the order is cancelled, and an ADL forced liquidation order is initiated.

?code=ZmY0MGNhMTc1NjBlNjJkOTg3MmI0OGFlM2NhZmQ1MmZfT0RUaW5VQmduRWtIQzdab2pxY2x6RFV3RE8zUkdsdFpfVG9rZW46V2hic2IxYXlvb21LZ0R4elpyYnU1ZlJjc09kXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

?code=OWIzYjlmZmI1MmZlNzAyNzRkYWU5MTk3NzZmZGM5MjdfSE5kUzViUFExMXd5bkZzeWVqYkwzRFJ6UjlFanJna3dfVG9rZW46VDI2cWIzRENvbzZuRnh4RWhiaHVGSjJnc2dlXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

Fund Flow Distribution:

For the entire position, with an entry price of 21 and an exit price of 25.2, the realized position's

Realized P&L = (25.2 - 21) * 10 = 42 loss

Closing Fee = 25.2 * 10 * 0.0006 = 0.1512

Liquidation Fee = positionIm - Realized P&L - Closing Fee = 42.1512 - 42 - 0.1512 = 0

Loss is exactly covered, resulting in no liquidation fee.

?code=OTIwMTQ2NzNjNGI3YjEyNDU5MTMwMDliMTYwMmFkYjBfWWVvVm1aV3hEU3lQY3UzaHVRT1U0UHhKdU00c0hnUHZfVG9rZW46UHZNQmJMUzJtbzA5ZHV4Q3RoZXVTUHU3c2JiXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

Trading History

Realized P&L = (25.2 - 21) * 10 = 42 loss

Close Position Fee = 25.2 * 10 * 0.0006 = 0.1512

?code=ZjUyMjQwM2MzZmI4MTNjNDRhNDdhOWU4YmMyMTQ0YzdfSHZ4MXhLQ3QzMUdmSzdkeGljcGhoQXY1VU5UWDJCNjNfVG9rZW46QUI3Y2JjZUNDb05oVWp4aThnQXVLaXVvc2RlXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

Position History

Realized P&L = (25.2 - 21) * 10 = 42 loss

Open Position Fee = 21 * 10 * 0.0006 = 0.126

Close Position Fee = 25.2 * 10 * 0.0006 = 0.1512

Total Fees = 0.126 + 0.1512 = 0.2772

?code=ZWY4YmYzOTQ4NjJkODQ0ZTBiMDYyOTI1NGIyOGIwNGJfbDRFVEhRNkNHak0yWGUxeGdYSDN2Q2sxbVNsVHQxYWlfVG9rZW46SVJMb2JZdHV4b2JkTWl4UHJlUnVXZHNZc1JiXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

Order History

Order Type: ADL (Auto-Deleveraging) Order

Realized P&L: 42

Liquidation Fee: 0

Close Position Fee: 0.1512 as taker

?code=ZTJkZTQwZDFkNzZmNThmN2UyNDA3MjFmOGM2YTZlMjZfNkNvYThrRHJJVTd4RXdZaXpWQ2hhYTlGNktrZGt2enRfVG9rZW46T1NPeGJKZm5Sb2w5aTl4bGdac3VSM3RVc3FnXzE3MTU2NzY5MDg6MTcxNTY4MDUwOF9WNA

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.