# Margin Trading

> Liqui Margin Trading introduces high-performance leveraged trading with advanced AI-powered risk management. Built on MegaETH, the system allows users to open long and short positions with dynamic leverage, precision liquidation mechanisms, and intelligent volatility-aware safeguards.
>
> An autonomous risk engine continuously adjusts parameters to optimize safety, capital efficiency, and user experience.

### Margin Modes

Liqui supports both Cross Margin and Isolated Margin, giving users full flexibility to manage risk and allocate capital according to their trading strategy.

### Cross Margin

In Cross Margin mode, all positions draw from a shared collateral pool. The protocol aggregates unrealized PnL and margin requirements to assess overall account health. This reduces the risk of premature liquidations by balancing profitable and unprofitable trades.

{% hint style="info" %}
Use Cross Margin when optimizing capital across correlated trades or a unified strategy.
{% endhint %}

### Isolated Margin

In Isolated Margin mode, each position is collateralized independently. Only that position’s margin and unrealized PnL are considered during liquidation, preventing losses in one trade from affecting others.

{% hint style="info" %}
Use Isolated Margin to contain risk per trade - ideal for high-leverage or high-volatility positions.
{% endhint %}

### Features

* **AI-Calibrated Margin Ratios**                                                                                                                                                                                              Leverage adjusts in real time based on volatility, liquidity conditions, and individual position risk.
* **Autonomous Liquidation Engine**                                                                                                                                                                                              Smart liquidation logic minimizes cascade effects and prevents front-running.
* **Predictive Risk Modeling**                                                                                                                                                                                              Each position is evaluated continuously based on live market data, enabling early warnings and preemptive protection.
* **Fully On-Chain and Transparent**                                                                                                                                                                                              All operations - from leverage application to liquidation - are executed by verified smart contracts, ensuring full transparency and auditability.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.liqui.io/trading/margin-trading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
