All e-books

Order Sweeping Algorithms in Forex Trading

How liquidity aggregators split orders across LPs for best execution: price aggregation, tie resolution, TIF mapping (IOC/GTC/FOK), and 18 real routing scenarios.

Get the e-book

Who is it for?

For FX and CFD brokers, COOs, dealing desks, risk teams, and product and engineering leads who work with multiple LPs and need consistent fills. It’s useful if you’re adding redundancy, battling off-market quotes, or evaluating an aggregator to protect execution quality.

It also fits teams that must explain routing outcomes to stakeholders. The book connects LP behavior, market depth, and order handling rules, so operations and dev can reason about fills, rejects, and slippage in production.

Inside the book

  1. Price aggregation and DoM (disclosed vs. undisclosed)
  2. Execution basics and VWAP benefits
  3. Order-sweeping workflow and triggers
  4. Mapping incoming to outgoing order types
  5. Time-in-force mapping (IOC, GTC, FOK)
  6. 18 execution scenarios (IOC/FOK nuances, tie-breakers, stop handling)

What will you learn from this book?

You’ll learn how aggregators form a single book from multiple LPs, split orders by price and size priority, and improve VWAP while reducing exposure to stale quotes. The book explains tie resolution, slippage controls, and why market orders are often swept as limits to control execution price. It also shows how the workflow iterates on rejects or partial fills and when the algorithm must stop.

You’ll be able to map TIF correctly (IOC/GTC/FOK), anticipate stop-order behavior, and brief teams with 18 routing scenarios: from “hit the same LP twice” to “avoid double hit,” “send full amount,” and handling no-response cases. Use these patterns to tune routing, set expectations on fills vs. speed, and document edge cases for support and compliance.

Reviews

“Many people associate liquidity aggregators with a metaphor of a switchman. The devil is always in the details, and simplifying can cost you millions. Most underestimate the degree of complexity, as well as the risks associated with numerous moving parts. This book offers an in-depth analysis of the algorithms and their processes. Take a look at what you should expect if you decide to engage with a liquidity aggregator. In this book, several atypical execution scenarios are detailed in great detail.
The authors and the whole Devexperts team deserve accolades for their efforts!”
Natallia Hunik portrait
Natallia Hunik
Chief Revenue Officer at CubeLogic
“The book gives Forex professionals a unique opportunity to look under the hood of perhaps the most complex module in the “risk management” mechanism. This knowledge gives the risk manager superiority in both day-to-day operations and in the selection of counterparts. And those who want to implement order-sweeping algorithms do not need to reinvent the wheel, but rather refer to Devexperts for a straightforward, academic implementation.”
vitaly-kudinov-review
Vitaly Kudinov
SVP of Business Development, Devexperts
“Sometimes you need to better understand how execution works rather than just its principles and ideas.
The book gives you these lenses, it gives you a set of examples that are equivalent to
open sourcing the actual algorithms. Except you don’t need to be a coder to grasp it.”
Jon Light
VP of Trading Solutions at Devexperts
Author
Evgeny Sorokin
Evgeny Sorokin authored this e-book during his tenure as Chief Product Officer at Devexperts. His work included implementing trading platforms for dozens of brokers worldwide, which deepened his understanding of brokerage operations and technology.