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

# Self-Trade Prevention

Lighter imposes a self-trade prevention mechanism. Trades between the same account cancel the resting order (maker) instead of executing the respective trade. Without this mechanism, self-trades would result in no position change and fees being paid unnecessarily.

Default (cancel maker): The resting order is cancelled in full, and the incoming order continues filling against the rest of the book.

Under the default behavior, the taker order fills as intended against the rest of the book, instead of being silently reduced. This only affects orders that don't explicitly specify a self-trade behavior. All four modes (cancel maker, cancel taker, cancel both, reduce both) will be allowed as explicit transaction attributes when placing the order. For more details, see [examples](https://github.com/elliottech/lighter-python/blob/main/examples/orders/self_trade_create_modify_order.py) in our Python SDK.
