Skip to content

Leg

The ‘Leg’ Table

When an order is split into multiple parts and sent to different liquidity providers (LPs), these parts are called legs. The leg table records the details of these legs, like the order ID, leg ID, and fill request details. It also captures which LP the fill request was sent to, the instrument being traded, the requested size and price, and other data.

Not all legs necessarily lead to deals. A leg can expire or might not receive a response from the LP, so the number of legs does not always equal the number of deals.

Attribute Description
order The unique ID for an order in the XCore system.
leg A unique identifier for each ‘leg’ of an order, generated when an order is divided into several parts for execution.
batch Identifies the sequence or batch of a leg. If a leg is rejected, it’s reattempted as a new batch.
b_book Book flag of the leg: 0 = A-book leg sent to a Liquidity Provider, 1 = B-book leg, 2 = cross-hedge leg, filled internally; the hedge is a separate A-book order (ClOrdID XH_<order>_<leg>) through the xHedge execution account. 3 = Synthetic A-book leg, booked against the synthetics maker; its hedges are separate orders on the source symbols (ClOrdID SH<n>-<order>-<leg>), usually A-book. Percentage B-book orders produce separate A-book and B-book legs.
provider Specifies the Liquidity Provider to which a leg was sent for execution.
protocol The type of Liquidity Provider used for the leg.
account The account ‘Tag 1’ value sent to the Liquidity Provider.
clordid The client order ID sent to the Liquidity Provider; by default <order>-<leg>, or SA-<order>-<leg> for Synthetic A-book legs.
type The type of the leg: market, limit or pq (prequoted), depending on the order type, the DealerTrade mode and the provider.
instrument The name of the instrument at the Liquidity Provider used for trade execution.
size The requested size of the leg sent for execution.
minsize The smallest execution size that can be sent to the Liquidity Provider for execution.
price The requested price of the leg sent for execution.
ttl The additional time in milliseconds that XCore will try to fill the leg, including subsequent legs.
markup_fix The fixed markup applied to the leg, including the skew component, from the MarkupProfile Bid and Ask markup settings. Legs that carried a skew are also recorded in the leg_markup table with the markup_fix and markup_skew components separated.
markup_flex The variable markups applied based on any MarkupProfile spread_min / spread_max settings.
quoteid Position of the selected quote in the aggregated execution book; 0 is the top of book.
quoteref The Liquidity Provider quote reference ID chosen by the XCore for leg execution.
quotetime The time XCore received the quote used for the leg, in epoch milliseconds.
quotetimelp The difference, in milliseconds, between the timestamp the Liquidity Provider put on the quote and the time XCore received it.
open_milli The millisecond timestamp when the leg was created in the XCore.
open_micro Unused; stored as 0.
fillsize The fill size of the leg, which is the total sizes of the deals confirmed by the Liquidity Provider.
fillprice The fill price of the leg confirmed by the Liquidity Provider.
fillprice2 The fill price including any XCore MarkupProfile markups.
close_milli The millisecond timestamp when the leg was completed in the XCore.
close_micro Microsecond counter (0–999999) when the leg was completed in XCore, not part of the timestamp; use it to calculate the difference between two events (the counter restarts every second).