Routing basics

In this article, we will review the basic principles of order execution models available on the BP, introduce the concept of routing rules, and look at order processing depending on the selected model

Long story short

The BP supports three types of order execution:

  • A-Book: A full order amount is executed on the liquidity provider side.

  • B-Book: A full order amount is executed internally on the BP, without involving a liquidity provider.

  • C-Book: An order amount is split, executing part of it on an LP and the remainder internally on the BP.

With the help of customizable routing rules, you can determine the execution model for each particular order based on its parameters, such as:

  • User

  • Account

  • Account group

  • Market

  • Market group

By combining these parameters, you can create rules that best suit your needs to better manage order processing on the BP and gain the maximum profit.

Routing rules
Routing rules

Order execution models

There are three types of order execution available on the BP: A-, B-, and C-Books.

A-Book (Target hedge, % = 100)

According to the A-Book policy, when placing an order on the BP, another order is created with the same parameters on the side of a liquidity provider (LP).

The funds for this second order are taken from a “hedge wallet” consisting of the Broker's funds at a specific LP. The Broker is responsible for managing its balances on the LP side.

After creating the order, the BP waits for a response from the LP and executes the order according to it.

A-Book execution model
A-Book execution model

B-Book (Target hedge, % = 0)

According to the B-Book policy, a placed order doesn't go beyond the BP and is executed using a copy of the order book received from an LP.

No Broker's funds are involved in the execution of B-Book orders. However, the Broker has obligations to the trader in case of withdrawal of purchased assets.

B-Book execution model
B-Book execution model

C-Book (Target hedge, % = from 1 to 99)

The C-Book policy combines elements of both A-Book and B-Book models. This approach allows Brokers to split an order, executing part of it on an LP and the remainder within the BP. This strategy helps mitigate risks compared to the B-Book flow and increases potential income in contrast to A-Book execution.

Protecting from arbitrage

When using a B-Book or C-Book policy, an order can be executed immediately since it doesn't go beyond the BP. As a result, the Broker should protect itself from arbitrage risks caused by high volatility. Another point is to keep the use of execution models hidden from traders.

For this purpose, the BP provides a configurable delay setting. When configuring a routing rule, the Admin can set a delay range for order execution using two parameters: Min delay, ms and Max delay, ms. This means that once an order is placed, it will be executed in an arbitrary number of milliseconds within the specified range between the Min delay, ms and Max delay, ms. The execution price will be taken from the actual state of the order book at the moment of order execution.

These settings help reduce the risk of arbitrage exploits by artificially increasing order execution time. They also emulate sending an order to a real LP, where delays are always different due to network conditions, routes, and so on.

Rounding

When processing C-Book orders, rounding may be necessary in two scenarios:

  1. The calculated A-Book portion is below the minimum order amount set by an LP.

  2. The amount scale for A-Book exceeds the allowed amount scale (for Spot markets) or lot size (for CFD markets).

To handle these cases, use the Round fractional volume to setting, which is available on the Routing page. It offers two options:

  • A-Book: Increases the initial order sent to the LP to meet the required minimum or rounds up to the valid scale.

  • B-Book: Processes orders internally on the platform if they fall below the LP’s minimum; if the A-Book portion exceeds the allowable amount scale or lot size, then the excess part is added to the B-Book portion.

Volume calculation:

  • The volume calculation includes rounding to the market's amount scale (Spot) or lot size (CFD).

  • Rounding applies to either the A-Book or B-Book portion of the order, potentially altering the percentage distribution initially set by the Broker (the Actual hedge, % of an order may differ from the Target hedge, %).

  • The remaining B-Book portion must be adjusted to ensure the total initial volume equals the sum of the A-Book and B-Book volumes.

Mind that choosing the A-Book option for rounding may result in higher commissions to be paid by the Broker, thought reduces their exposure to potential risks.

Handling orders with amounts less than minimum

When an A-Book order (Limit GTC, GTD, or Day) is only partially filled and the remaining volume is less than the required minimum amount, it will not be accepted by an LP for execution. To address this, the leftover amount is executed using the B-Book model, within the BP.

Routing rules

Routing rule is a set of conditions that determine which execution model should be applied to a particular order.

The routing rule can be configured based on User & Account criteria and Market criteria.

The User & Account criteria support the following conditions and their combinations:

  • User: The rule is applicable to orders placed by a specified trader.

  • Account group: The rule is applicable to orders placed from accounts included in a specified account group.

  • User + Account: The rule is applicable to orders placed from a specified account of a specified trader.

  • User + Account group: The rule is applicable to orders placed from accounts of a specified trader that are included in a specified account group.

If none of the above is specified, the rule is applied to all traders and accounts registered on the BP.

The Market criteria support the following conditions:

  • Market: The rule is applicable to orders placed on a specified market.

  • Market group: The rule is applicable to orders placed on markets that are included in a specified market group.

If none of the above is specified, the rule is applied to all markets available on the BP. Note that either Market or Market group can be specified, the Market + Market group combination isn’t supported.

The Market criteria can be combined with any possible User & Account criteria.

Routing rules are ranked according to their priority (1 is the highest priority). This means that if multiple routing rules are applicable to a given order, the one with the higher priority will be applied.

The BP has the default routing rule with the following customizable parameters:

  • Hedge, % = 0

  • Min delay, ms = 200

  • Max delay, ms = 300

Other parameters of the default routing rule are set to None and can't be edited. The default routing rule can't be deleted and its priority is always the lowest.

How it works

The processing of an order based on routing rules is as follows:

1

Search for routing rules

The BP checks the order against the configured routing rules by comparing the user, account group, account, market group, and market parameters.

2

Select the routing rule

Among the rules whose conditions are met in the order, the rule with the highest priority is selected.

If no rules are applicable to the order, the default routing rule is applied.

3

Order execution based on the selected rule

If the applied rule has Target hedge, % = 100, the BP sends a request to create a "copy" of the order on the LP's side. The BP can create one or more orders on the LP side depending on the original order type and Time in force. All further actions depend on responses from the LP. The order is considered executed when it's executed on the LP's side and a corresponding response is received.

The BP extracts the Min delay, ms and Max delay, ms parameters from the rule. For example, the minimum delay is set to 300 ms and the maximum delay is set to 500 ms. Then each execution will occur in 300 ms + some random number of ms from 0 to 200 (500 – 300). Prices in the order book are updated 10 times per second: every 100 ms. In this particular case, the delay includes five price updates: from 0 ms (the moment the order is placed) to 500 ms (the maximum delay). For example, the order is executed in 413 ms after it's placed. In this case, the order is executed at the price recorded in 413 ms after the order was placed, that is, at the fourth update of the order book received from the LP.

Finally, if the applied rule has Target hedge, % from 1 to 99:

  1. The BP calculates a percentage of the order amount specified in the Target hedge and treats it as if the Target hedge was set to 100% (A-Book), sending that portion to the LP.

  2. The remaining part is treated as if its Target hedge was set to 0% (B-Book): the BP executes it internally.

Once the A-Book part is executed, its execution price is compared to the Volume Weighted Average Price (VWAP). If the A-Book's execution price is better than the VWAP, the B-Book executes at the VWAP; otherwise, the A-Book price is used for B-Book execution. Execution sizes for both book orders are proportional. Thus, if 40% of the A-Book is executed, 40% of the B-Book follows. This ensures traders see accurate execution amounts in the Trading terminal, while details of B-Book executions remain concealed.

Regardless of the execution model, the GTC, GTD, and Day limit orders are initially placed in the of the BP and remain there until the price trigger is received from the LP.

Last updated

Was this helpful?