> For the complete documentation index, see [llms.txt](https://docs.velio.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.velio.xyz/trading/margin-and-liquidation.md).

# Margin & Liquidation

Maintenance margin, when positions are liquidated, and how to avoid it.

### Maintenance margin

Every position must keep a minimum amount of margin, called the **maintenance margin**. It depends on your position's size, not on the leverage you chose. The rate is tiered: larger positions need a higher maintenance margin rate.

**Example:** for BTC/USDC, a 100,000 USDC position has a maintenance margin rate of 1.25%, so it must keep at least 1,250 USDC of margin.

### When is a position liquidated?

If your margin plus unrealized PnL, measured at the mark price, falls to the maintenance margin, your position is liquidated. All or part of it may be closed.

The **estimated liquidation price** is shown before you place an order and on every open position. It changes as you add or remove margin, change positions or pay funding.

### Liquidation fee

A liquidation is charged a **2% liquidation fee** on the value of the position closed. Closing a risky position yourself is far cheaper:

| For a 20,000 USDC position    | Cost            |
| ----------------------------- | --------------- |
| Closing it yourself at market | 9 USDC (0.045%) |
| Being fully liquidated        | 400 USDC (2%)   |

### Avoiding liquidation

* Use moderate leverage and size positions so one trade can't wipe out your account.
* Set a stop loss on every position, triggered by the mark price and well away from the liquidation price.
* Watch the risk indicator for your account, not just the PnL percentage.
* Add margin to isolated positions, or deposit more funds for cross positions, to move the liquidation price further away.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.velio.xyz/trading/margin-and-liquidation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
