Reference / Trade execution

The likely-price check

Before a plain single order is sent, Praxis tries to compare the price it would likely average at against the middle of the order book, and can refuse the order on the result.

Contents

Anything asking to be fed out over time, placed at several price levels, shown to the market in a smaller amount, or given protective orders is queued the same way but carried out along its own path, and never reaches this check. Work fed out or laddered is ended unstarted if its deadline has already passed; an opening order with protection, or one part-shown to the market, is not checked for that.

The comparison

The figure is how far the average sits above the middle, counted in hundredths of one percent. For a buy it is used as it stands; for a sell the sign is reversed first, so that either way a worse price gives a bigger number. That is what gets compared against the limit.

What it can do

Every order that gets as far as sending has that price worked out; one already dropped by a cancellation never is. Asking the venue for the book can itself fail, and then there is no figure to judge.

Only a market order can be stopped by the result, and only where the host has been given a limit on how far the price may stray. Such an order is stopped when the figure goes past that limit, and stopped too when there was no figure at all; a figure within the maximum lets it through. Every other order is sent whatever came back.

Source evidence
---
row: P1-05
baseline: 49aa659
created: 2026-09-20 16:58 UTC
modified: 2026-10-04 11:43 UTC
evidence:
  - claim: "Every other kind is routed elsewhere before this path"
    source: "`execution_manager.py` 3994-4009, with a defensive refusal for anything that still arrives at 4170-4188, returning instead of reaching the fetch at 4192-4197"
  - claim: "The book is fetched only after the drop and mode checks have let the order past"
    source: "dropped at `execution_manager.py` 4154-4168, or refused for its mode at 4170-4188, otherwise fetched at 4192-4197"
  - claim: "A failed book request leaves no figure and no comparison is made"
    source: "`execution_manager.py` 4222-4228 leaving the estimate unset"
  - claim: "Work fed out or laddered is ended unstarted past its deadline"
    source: "either `execution_manager.py` 3995-3996 or 4004-4005, both into 4123-4129"
  - claim: "A bracket or hidden-size order has no such deadline test"
    source: "either `execution_manager.py` 4000 or 4002"
  - claim: "For a sell the figure is flipped in sign before the comparison"
    source: "`execution_manager.py` 4081-4085"
  - claim: "A figure within the maximum lets the order through"
    source: "`execution_manager.py` 4087-4088, returning no reason, so the send follows at 4268-4280"
  - claim: "The limit is one setting for the whole host, not part of the order"
    source: "`execution_manager.py` 680 with 4064-4065"
  - claim: "Only a market order, and only where the maximum is configured, can be stopped by any of this"
    source: "`execution_manager.py` 4064-4065"
  - claim: "No figure stops such an order"
    source: "`execution_manager.py` 4067-4079"
  - claim: "Being stopped ends the work unsent"
    source: "`execution_manager.py` 4232-4240"
---

Edit this sourceCheckout revision · 7381aa49
Reference / keep your place
Find a passage