RFX Documentation
  • Overview
  • Liquidity Providers
    • RFX v2 (Sonic): RFX Shared Liquidity Vaults
    • RFX v1 (zkSync): Liquidity Pools
    • LP Risk Management
  • Traders
    • RFX v2 (Sonic)
      • Perps
    • RFX v1 (zkSync)
      • Perps
      • Swaps
    • Liquidations
    • Price Impact
  • Fees
  • One-Click Trading
  • Permissionless Markets
  • Oracle System
  • Security
Powered by GitBook
On this page
  1. Traders

Liquidations

This section provides an overview of how liquidations work on RFX

PreviousSwapsNextPrice Impact

Last updated 6 months ago

The Liquidation Price is calculated as the price at which the (collateral - losses - fees) is less than 1% of your position's size. If the token's price crosses this point then the position will be automatically closed. Any collateral remaining after your position is liquidated will be returned to your wallet.

The exact formula for liquidation is:

For long liquidation,

Pjlong=max{Pi((5−C)/(LC)+1)Pi((0.01L−1)/(L)+1)P^{long}_j = max\begin{cases} P_i((5-C)/(LC)+1) \\ P_i((0.01L -1)/(L)+1) \end{cases} Pjlong​=max{Pi​((5−C)/(LC)+1)Pi​((0.01L−1)/(L)+1)​

For short liquidation,

Pjshort=min{Pi((C−5)/(LC)+1)Pi((1−0.01L)/(L)+1) P^{short}_j = min\begin{cases} P_i((C-5)/(LC)+1) \\ P_i((1-0.01L )/(L)+1) \end{cases} Pjshort​=min{Pi​((C−5)/(LC)+1)Pi​((1−0.01L)/(L)+1)​

where:

C is collateral in USD

L is leverage (eg. 3x is 3).

P_i is Entry Price

P_J is Liquidation Price

For example, if you put down $100 collateral for a 5x long position PNL% can be rewritten as a fraction of the price difference between entry (p_i) and exit (p_j) price.

The price used to calculate whether a position is liquidatable is based on the oracle price and after factoring in a capped negative price impact. This price does not factor in positive price impact and negative price impact is capped to 1%. When the position is liquidated the actual positive and negative price impact is applied to close the position.

Due to borrowing and funding fees your liquidation price will change over time, especially if you use a leverage that is more than 10x and have the position open for more than a few days, so it is important to monitor your liquidation price.

Traders can add more collateral to their position to improve their Liquidation Price. You can monitor the health of your position in the Positions Tab on the page.

Trade