# Self-trade Prevention

Self-trade prevention stops an account from trading against itself.

If an incoming order would match a resting order from the **same address**, the resting order is canceled instead of matched.

### What happens

* No trade is executed
* No trading fees are charged
* The cancel does **not** appear in the public trade feed
* The incoming order can continue matching against other resting liquidity, subject to its limit price and normal execution rules

### Why this exists

This behavior prevents wash-like fills and avoids unnecessary internal crossing.

It is especially useful for market making strategies. An aggressing order can keep matching against other liquidity behind the canceled resting order instead of stopping on a self-match.

On centralized exchanges, this behavior is often called **expire maker**.

### Scope

Self-trade prevention applies when both sides of the potential match belong to the **same address**.

It affects matching behavior only. Margin checks, price validation, and other order-entry rules still apply as normal.

See [Orders](/trading/orders.md) for order behavior and [Price Feeds](/trading/price-feeds.md) for pricing guardrails.


---

# 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.margin.trade/trading/self-trade-prevention.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.
