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) are available as explicit transaction attributes when placing the order. For more details, see examples in our Python SDK.
Last updated
Was this helpful?