Skip to main content
Back to blog
Risk Management11 min readJune 17, 2026

Toxic flow and B-book risk: how brokers protect their book on MT5

What toxic flow really is, how the A-book/B-book hybrid model works, and the three server-side defences a B-book broker needs: execution control, live exposure hedging, and scheduled leverage tightening.

The short answer

If you run a B-book, your profit and loss is the mirror image of your clients' trading. When they lose, you keep it. When they win, you fund it. That model is fine until two things happen: a slice of your flow starts winning systematically (toxic flow), or your book drifts into a large one-directional position right before the market gaps against you (concentrated exposure).

Neither problem is solved by your trading platform alone. MT5 routes orders and keeps accounts. It does not decide how a scalper's fill should differ from a VIP's, it does not watch your net gold exposure tick by tick, and it does not tighten leverage before a weekend. That control lives in the server-side risk layer that sits on top of the platform.

This article explains what toxic flow is, how the A-book and B-book models actually work, and the three layers of defence a B-book broker needs: execution control, exposure control, and leverage control. It uses BrokerTech's MT5 plugins as the worked example, but the logic applies whatever vendor you use.

A-book, B-book, and the hybrid reality

Three terms get thrown around loosely, so it is worth being precise.

  • A-book. You pass the client's trade to a liquidity provider and earn the spread or a commission. You carry no market risk on that position. Your revenue is small per trade but predictable.
  • B-book. You internalise the trade and take the other side yourself. The client's loss is your revenue, and the client's profit is your cost. Margins are far higher, and so is the risk.
  • Hybrid. Almost every serious broker in 2026 runs both, and routes flow by client segment. Losing retail clients stay on the B-book where the margin is. Sharp, consistently profitable clients get sent to the A-book where they become someone else's problem.

The whole game of running a profitable book is deciding, per client and per trade, which bucket the flow belongs in, and protecting the B-book from the flow that should never have been there.

What "toxic flow" actually means

Toxic flow is trading that is profitable against your B-book for reasons that have nothing to do with a client being a skilled discretionary trader. It is structural, repeatable, and it scales. The common types:

  • Latency arbitrage. The client's feed updates a few milliseconds before your server's price does, and they trade the gap. They are not predicting the market, they are reading your stale quote.
  • Price-feed or stale-quote sniping. During fast moves, your quotes lag the real market for a moment. Automated clients fire into that lag.
  • News-spike trading. Around high-impact releases, spreads and slippage behaviour change. Some clients exist only to hit those windows.
  • Scalping on the touch. Hundreds of tiny trades that each capture a fraction of the spread, profitable only because execution is too generous.
  • Copy-trade and signal swarms. One sharp account, mirrored by fifty others, turns a single edge into fifty correlated positions on your book.

None of this is illegal, and most of these clients believe they are simply trading well. The point is not to moralise. The point is that this flow loses you money on the B-book by design, and your job is to either neutralise the edge or route the client to the A-book.

The two failure modes, and why they need different tools

Brokers tend to lump all of this under "risk," but there are really two separate failure modes, and they call for different instruments.

  1. The execution problem. A subset of clients extracts value through how their trades are filled. This is fixed at the moment of execution, on a per-client basis. The tool is a dealing-desk layer.
  2. The exposure problem. Even with clean flow, your B-book can accumulate a large net position in one symbol. If 200 clients are all long gold and gold gaps down over the weekend, the execution quality of each trade is irrelevant. The tool is live exposure monitoring with hedging, plus leverage control around the risky hours.

Mix these up and you over-engineer one while leaving the other open. A good risk stack covers all three layers below.

Layer 1: execution control with a dealing-desk plugin

A dealing-desk plugin sits between the incoming trade request and the fill, and applies your rules before the trade is booked. For each request reaching the server it answers three questions: fill instantly or wait, fill at what price, and apply how much slippage.

The configuration that matters:

  • Rules by segment. Target rules by login, account group, symbol, or any combination, so latency-sensitive scalpers, arbitrage clients, and VIP accounts are each handled differently. A capable plugin holds up to 200 such rules.
  • Execution delay. Add a configurable min and max delay range so each fill feels natural rather than scripted, set per rule and per segment.
  • Fill-price strategy. Choose the fill: the latest tick, the best price seen during the delay, or the worst price seen during the delay. The key is that the chosen price is real and recorded, so it is always defensible.
  • Slippage control. Add slippage as fixed points or a random range, with an optional hard cap on total deviation from the requested price.
  • Audit logging. Three logging levels, from day-to-day monitoring to full audit, so every routing decision and price selection is recorded for compliance review.

A concrete example. A latency-sensitive scalper on XAUUSD gets an 80 to 120 millisecond delay, a fill at the worst price seen during that wait, and 0 to 2 points of added slippage. A VIP institutional account on EURUSD gets an instant fill with no slippage. Same plugin, two policies, applied per request in real time.

A word of caution, because this is the layer brokers most often abuse: execution control is a defence against structural arbitrage, not a tool for quietly degrading every client's fills. Overdo it and you create a worse problem, namely clients who notice, complain, and leave. The defensible version applies measured friction to genuinely toxic segments and keeps a clean audit trail for everyone.

Layer 2: exposure control with a B-book risk manager

Execution control cleans up individual trades. It does nothing about the aggregate position your book is carrying. That is the job of a B-book risk manager: live visibility into your net exposure, with the option to reduce it automatically.

What it does:

  • Live net exposure. A real-time net long and short figure per symbol, account group, and book, updated on every tick.
  • Per-symbol limits. Custom long and short thresholds for each instrument. Gold, EURUSD, indices, and crypto each get their own limits, because their risk profiles are nothing alike.
  • Monitor or auto-hedge. Run it as a pure dashboard with alerts and reports, or hand it the keys and let it place hedge trades on your cover account automatically.
  • Symbol mapping. Map client-book symbols to cover-account symbols, so XAUUSD.p on the client side becomes GOLD on the LP without manual translation.
  • Hedge cooldown. A built-in cooldown between hedge trades so the plugin cannot spam your cover account during volatile windows.
  • Periodic re-check. Reconciliation against the server on a schedule, so the figures stay accurate after restarts or network blips.

A worked example. You have 50 lots open on XAUUSD across your B-book, and your threshold is set to 30 lots. The plugin hedges the 20-lot excess on your A-book LP, mapping XAUUSD.p to GOLD on the cover account. As clients close positions the hedge scales down, and as they add more it scales up, keeping your net risk inside the band you set without anyone watching a screen at 2am.

This is what turns the B-book from a gamble into a managed position. You keep the spread and the losing flow, and you cap the tail risk on the part of the book that has run too far in one direction.

Layer 3: leverage control with dynamic margin

The third layer addresses risk that is about timing rather than flow or position size. Leverage that is perfectly reasonable on a Tuesday afternoon is dangerous over a weekend or across a major news release, because that is when markets gap and stop-outs fail to fire at the expected level.

A dynamic-margin plugin tightens leverage on a schedule, without disturbing existing positions or changing your traders' normal leverage the rest of the time.

  • Schedule-based rules. Tighten leverage during weekends, news events, overnight sessions, or holidays, with multiple time windows per rule. A capable plugin supports up to 128 rules, each targeting specific groups and symbols.
  • Virtual margin on new trades. Trades opened inside a restricted window are evaluated against a stricter virtual margin, while everything already open keeps running normally.
  • Two enforcement modes. Partial mode restricts new positions only. Total mode recalculates all positions for maximum protection during critical events.
  • Auto force-close. If an account breaches the virtual stop-out level, the plugin closes the worst-performing position itself, with no manual intervention.
  • Compliance log. Every rule trigger, virtual margin breach, and force-close action is logged and exportable for audit.

The classic case is the Friday-to-Sunday gap. You cut effective leverage on index and metal symbols from, say, 1:500 to 1:100 from Friday close to Sunday open. Clients keep their existing positions, but nobody can pile into a fresh, maximally leveraged position into the weekend gap. Monday's open stops being the day you discover a client blew through your stop-out and left you with the loss.

How the three layers work together

Run on their own, each plugin closes one gap. Run together, they form a single risk posture:

  1. DealingDesk decides how each trade is filled, neutralising the structural edge of toxic segments at the moment of execution.
  2. B-Book Risk Manager watches what those trades add up to, and hedges the excess when your net position in a symbol runs past your limit.
  3. Dynamic Margin tightens the screws during the hours when a gap would hurt most, and force-closes accounts that breach the stricter limits.

Managed from one configurator with hot-reload, changes apply in one to two seconds without restarting the server, so you can adjust policy during a live event rather than waiting for a maintenance window.

How to evaluate a risk stack

If you are comparing vendors or building this in-house, these are the questions that separate a real risk layer from a checkbox feature:

  • Does execution control let you target rules by login, group, and symbol together, or only crudely by group?
  • Are fill prices that the plugin selects always real prices that occurred, and are they logged for audit?
  • Does the B-book monitor update on every tick, or poll on a slow interval that misses fast moves?
  • Can it hedge automatically to a cover account, including symbol mapping between your book and the LP?
  • Is there a cooldown so auto-hedging cannot thrash your cover account during volatility?
  • Can leverage rules run on a schedule with both partial and total enforcement, and force-close on breach?
  • Do changes apply live, or does every adjustment need a server restart?
  • Is every risk action exportable for compliance review?

A vendor that answers yes across all three layers is selling a risk system. One that only does execution, or only does a static exposure dashboard, is selling a fraction of one.

Key takeaways

  • Toxic flow is structural, repeatable trading that beats your B-book for reasons unrelated to skill, and it needs to be neutralised or routed to the A-book.
  • B-book risk splits into two distinct problems: how trades are executed, and how much net exposure the book carries.
  • Execution control (a dealing-desk plugin) applies per-segment delay, fill-price, and slippage rules at the moment of the fill, and must stay defensible and logged.
  • Exposure control (a B-book risk manager) tracks live net exposure per symbol and auto-hedges the excess to a cover account.
  • Leverage control (a dynamic-margin plugin) tightens leverage on a schedule around weekends and news, with auto force-close on breach.
  • All three should run server-side on MT5, managed centrally, with live hot-reload and full audit logs.

Next step

If you run a B-book on MT5 and want to see how execution control, live exposure hedging, and scheduled leverage tightening fit together, we can walk you through the plugins on your own symbols and account groups. Book a demo at brokertech.ai/demo, or read the technical detail on the MT5 Plugins page.

Share
Published by BrokerTechI Tech Solutions Ltd