# Liquidation

#### **1. Overview**

The TRS system enforces a minimum maintenance margin requirement to manage risk. If a user's net asset value falls below the required threshold, liquidation is triggered to mitigate potential losses.

* **Maintenance Margin Rate:** X% (differ from the underline assets)
* **Liquidation Condition:** A user’s net assets must be at least X% of the position value; otherwise, liquidation occurs.

***

#### **2. Liquidation Price Calculation**

**2.1 Long Position Liquidation Price**

For long positions, the net asset value is calculated as:

<figure><img src="https://3526437504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fswmb7WC15eHGwLVBawz0%2Fuploads%2FOZGIvvdxyTYDESYqOopj%2Fimage.png?alt=media&#x26;token=f1a75fcf-eebf-414a-86ba-f78e501a4644" alt=""><figcaption></figcaption></figure>

Debt accrues over time:

<figure><img src="https://3526437504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fswmb7WC15eHGwLVBawz0%2Fuploads%2F09tzdOthCnESJLUQMlwY%2Fimage.png?alt=media&#x26;token=49a757b5-afdc-4f94-a2a1-477fb1728898" alt=""><figcaption></figcaption></figure>

where:

<figure><img src="https://3526437504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fswmb7WC15eHGwLVBawz0%2Fuploads%2FU5SG9Jh49cMaM5ZftGzs%2Fimage.png?alt=media&#x26;token=aff45dfa-8656-443c-bf96-b8d633de645d" alt=""><figcaption></figcaption></figure>

Thus, the liquidation price for long positions is:

<figure><img src="https://3526437504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fswmb7WC15eHGwLVBawz0%2Fuploads%2FLmRZB6bafIiPJMmqYksV%2Fimage.png?alt=media&#x26;token=25d0a1e6-9a14-460e-9024-86faea77ddf9" alt=""><figcaption></figcaption></figure>

***

**2.2 Short Position Liquidation Price**

For short positions, the net asset value is calculated as:

<figure><img src="https://3526437504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fswmb7WC15eHGwLVBawz0%2Fuploads%2FYOXtFLccnVdmQajFp7n1%2Fimage.png?alt=media&#x26;token=87d7b9b6-b3e0-4b89-a4ce-af8c486f5a60" alt=""><figcaption></figcaption></figure>

Debt quantity accrues over time:

<figure><img src="https://3526437504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fswmb7WC15eHGwLVBawz0%2Fuploads%2FeX2r68ULrJUv3njMgjOY%2Fimage.png?alt=media&#x26;token=cf8537a5-c27e-413b-8042-c004cab7cca4" alt=""><figcaption></figcaption></figure>

Thus, the liquidation price for short positions is:

<figure><img src="https://3526437504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fswmb7WC15eHGwLVBawz0%2Fuploads%2F3e15kyfT8On4IR4jFd4q%2Fimage.png?alt=media&#x26;token=2d5c84e6-5e24-44f2-abb8-ad6822720c67" alt=""><figcaption></figcaption></figure>

***

#### **3. Liquidation Protection Mechanism**

To prevent unnecessary or abnormal liquidations, the TRS contract incorporates an additional validation step:

* When liquidation is triggered, the contract first verifies whether the AMM price confirms the expected liquidation condition.
* If the AMM price does not meet the expected conditions, liquidation is halted to protect users from unintended liquidations due to temporary price fluctuations.

This dual-check mechanism ensures a fair and stable liquidation process, minimizing unnecessary liquidations and enhancing user security.

***

#### **4. Summary**

* The TRS system enforces a maintenance margin rate to determine liquidation.
* Liquidation prices are calculated differently for long and short positions.
* A secondary AMM price validation ensures liquidations only occur under proper conditions.

This mechanism safeguards users from abnormal liquidations while maintaining the system’s risk management integrity.
