Self-Trade Prevention

Overview

Bulk Exchange implements a standard Self-Trade Prevention (STP) mechanism to prevent users from matching orders with themselves. This is a crucial feature for market integrity and is particularly important for market makers and sophisticated algorithmic traders who may have orders on both the bid and ask side of the order book simultaneously.

The core principle of STP is to avoid unintentional trades that do not represent a true transfer of risk or assets, which would result in the user needlessly paying trading fees.

Mechanism

The STP logic is handled by the matching engine. The process is as follows:

  1. An incoming (aggressing) order is submitted to the order book.

  2. The matching engine checks if the aggressing order would cross the spread and match with a resting (maker) order.

  3. Before executing a trade, the engine checks if the account_id of the aggressing order is the same as the account_id of the resting order.

  4. If the account IDs are identical, a self-trade is detected.

  5. Instead of a trade being executed, the resting maker order is immediately canceled.

The aggressing order then continues to be processed, potentially matching against the next available order in the book from a different trader.

Behavior and Benefits

  • No Trade Execution: A self-trade is never filled. The system treats it as a cancellation of the passive order.

  • No Fees: Since no trade occurs, no trading fees are charged for the prevented match.

  • Market Maker Friendly: This behavior, often referred to as "Expire Maker" or "Cancel Resting" on other exchanges, is highly desirable for market makers. It allows them to place an aggressive order that can trade through their own resting liquidity to access deeper liquidity on the order book without being filled against themselves.

  • Trade Feed: The event is not recorded as a trade in the public trade feed. It is treated simply as an order cancellation.

This mechanism ensures a fair and efficient market structure, allowing traders to manage their orders effectively without incurring costs from unintentional self-trades.

Last updated