Trade
The XCore trade data structure is designed to meticulously track order execution at every stage. It is organized into a hierarchy consisting of three interconnected categories: order, leg and deal, with the supporting leg_markup table. This structure provides a comprehensive and granular view of each trade’s lifecycle, from the initial order placement to its final execution.
The Logic Behind the Structure:
The structure reflects the actual process of executing an order in the market, capturing detailed information at every level:
- A single order can be split into multiple legs.
- Each leg can generate multiple deals.
- Each leg can have one leg markup record.
This hierarchy enables detailed tracking of how trades are executed:
- Order: Represents the full trade instruction from the Connector (Taker). It includes high-level information such as the client’s account, the traded instrument, order size, type, and pricing details.
- Leg: Represents the portion (or all) of the order that XCore processes for execution. Legs can be executed by different liquidity providers (LPs) or handled internally by XCore.
- Deal: Captures the final confirmation of the execution of a leg. A leg can result in zero, one or multiple deals based on how the execution is filled.
- Leg Markup: Records the fixed and skew markup components applied to a leg, linked to it by the order ID and leg ID.
This structure allows XCore to capture detailed information at every stage of an order transaction, from the general details of the order to the specific data about the legs and deals. Through this approach, the XCore Order Data facilitates meticulous tracking and analysis of all trading activities on the platform.
Two auxiliary tables complete the set. book stores the aggregated bid and ask books captured when a leg opens (columns order, leg, side, book). Books can also be captured when an order closes without opening a leg, provided a pool book is available and the order did not fail a margin check. leg_markup stores the fixed and skew markup components of legs that carried a skew (columns order, leg, markup_fix, markup_skew).
