Case Study: Order Status & Transition
Understanding order statuses and transitions through practical examples in the Fixed-Rate Lending Protocol
Last updated
Was this helpful?
Understanding order statuses and transitions through practical examples in the Fixed-Rate Lending Protocol
Last updated
Was this helpful?
This case study explores the entire spectrum of order statuses through detailed examples, incorporating our platform's price range limit mechanism, , for practical understanding.
The chart below illustrates how different order types (Market, Overlapping Limit, and Non-Overlapping Limit) interact with various order statuses throughout their lifecycle. This chart, combined with the Order Life Cycle explanation, provides a comprehensive understanding of how orders progress through the system and how exceptional cases are handled.
When using this chart:
First identify your order type (column)
Then follow the possible statuses (rows) that apply to your order type
Note that some statuses are marked as "Not applicable" for certain order types
Pay attention to "Final" statuses which represent the end of an order's lifecycle
Combined states (like "Partially Filled & Blocked") indicate orders that were partially executed before reaching a terminal state
This chart works in conjunction with the Circuit Breaker mechanism, which prevents extreme price movements by limiting the range within which orders can execute.
The chart below serves as a comprehensive guide to understanding how orders move through different states in the Fixed-Rate Lending Protocol. Each order type follows a specific path through the system:
Market Orders: These are intended for immediate execution and typically transition directly to "Filled" status if there's sufficient liquidity. If there's partial liquidity, they may become "Partially Filled" before reaching a terminal state like "Killed" or "Blocked".
Overlapping Limit Orders: These orders match with existing orders in the orderbook and can be executed immediately. They may be "Filled" completely, "Partially Filled" (with the remainder staying open), or transition to "Cancelled" or "Expired" states if the user cancels them or they reach maturity.
Non-Overlapping Limit Orders: These orders don't match with existing orders and remain "Open" in the orderbook. They can later transition to "Partially Filled", "Filled", "Cancelled", or "Expired" states depending on market conditions and user actions.
The exceptional cases are handled through specific status transitions:
Orders that would execute outside the Circuit Breaker price range become "Blocked"
Orders that can't be filled due to insufficient liquidity become "Killed"
Orders that reach maturity without being filled become "Expired"
By understanding these transitions, users can better predict how their orders will behave under different market conditions and take appropriate actions to manage their positions.
Order Statuses
Possible states an order can be in
Open, Partially Filled, Filled, Killed, Blocked, Cancelled, Expired
Final Statuses
Order states that cannot transition further
Filled, Killed, Blocked, Cancelled, Expired
Circuit Breaker Range
Price range within which orders can be executed
±2% from last price (in example)
Order Types
Types of orders that can be placed
Market, Limit (Overlapping and Non-Overlapping)
Order Sides
Sides of the orderbook
Buy (Lend), Sell (Borrow)
Open
Not applicable; enters immediate execution
Rare; unless no overlapping order
Waits for the market to reach the limit price
Partially Filled
Only used as a combined state; no remaining orders (ex. Partially Filled & Blocked)
Partial execution if not enough liquidity; remains until further filled or terminated
If the market reaches the limit price but not fully executable due to liquidity, stays until more activity
Filled (Final)
Immediately fully executed at current market prices with sufficient liquidity
Fully executed once the market fully meets the limit price
Fully executed once the market fully meets the limit price
Killed (Final)
Removed if cannot be fully executed due to lack of liquidity
Not applicable; remains in the market as Partially Filled or Open
Not applicable; remains in the market as Partially Filled or Open
Blocked (Final)
Removed if cannot be fully executed due to circuit breakers
Not applicable; remains in the market as Partially Filled or Open
Not applicable; remains in the market as Partially Filled or Open
Cancelled (Final)
Not applicable as they are executed immediately
Can be canceled before execution or after being Partially Filled
Can be canceled at any point before being fully executed
Expired (Final)
Not applicable as they are executed immediately
Expires if not executed within a specific timeframe after being Partially Filled
Expires if the set timing (ex. maturity) passes without full execution
Our scenario unfolds within the bounds of an order book, structured around three key order types: 'Market Order', 'Overlapping Limit Order', and 'Non-Overlapping Limit Order'. Let's consider the following order book setup:
Example: Buy 10 at market.
Transition: Order is Filled purchasing 10 units at 91.
Example: Buy 20 at market.
Transition: Order is Partially Filled with 10 units at 91, remaining 10 units are Killed due to lack of liquidity up to the upper limit.
Example: Sell 10 at market.
Transition: Order is Partially Filled with 5 units at 89, remaining 5 units are Blocked then Killed due to no liquidity at the lower limit.
Example: Buy 10 at 91.
Transition: Order is Filled with 10 units at 91.
Example: Buy 15 at 93.
Transition: Order is Partially Filled with 10 units at 93. Remaining 5 units are kept open at 93 but cannot be executed until the market moves and the circuit breaker price is adjusted to allow execution.
Example: After being partially filled, cancel the remaining order.
Transition: Remaining order is Canceled.
Example: Buy 15 at 91; remaining 5 units are kept open. Then no fill and lending market matures.
Transition: Order Expires after the maturity time passes.
Example: Buy 10 at 89.
Transition: Order is Open, awaiting a match.
Example: Buy 10 at 89 (total 15 Open on the orderbook), then another trader sells 10 at 89.
Transition: Order is Partially Filled with 5 units at 89, 5 units remain open.
Example: After being partially filled, cancel the remaining order.
Transition: Remaining order is Canceled.
Example: Buy 10 at 89, no fill and lending market matures.
Transition: Order Expires after the maturity time passes.
When an order is partially filled, the filled portion becomes a position, while the unfilled portion remains in the orderbook as an open order. You can choose to leave it open, cancel it, or wait for it to be filled. For market orders, the unfilled portion may be killed or blocked depending on market conditions and circuit breaker limits.
Market orders can be blocked when they would execute at a price outside the circuit breaker limits. This is a safety mechanism to prevent extreme price movements and protect the market from manipulation. When a market order is blocked, the unfilled portion is killed and removed from the orderbook.
No, you cannot modify an existing order. If you want to change the price or amount, you'll need to cancel your existing order and place a new one with the updated parameters. This ensures price-time priority is maintained fairly in the orderbook.
Killed: An order is killed when there's insufficient liquidity to fill it completely. This typically happens with market orders when there are no more matching orders in the orderbook.
Blocked: An order is blocked when its execution would violate the circuit breaker price limits. This is a safety mechanism to prevent extreme price volatility.
Any open or partially filled orders in a market that reaches maturity will automatically expire. This means they are removed from the orderbook and will not be executed. Any filled portions of orders have already become positions and will be subject to the auto-rolling mechanism.