Summary
When a large market order would exceed the pool's available OI capacity (due to max_open_interest cap), the entire order currently reverts. A partial fill model would allow the order to execute up to the OI cap and queue the remainder.
Proposed Design
Add allow_partial_fill: bool to CreateOrderParams.
When true:
- Execute up to
min(requested_size, remaining_oi_capacity)
- Store the unfilled remainder as a new pending order with the same params
- Emit
OrderPartiallyFilled { nonce, filled_size, remaining_size }
When false (default): current behaviour (revert if full size not fillable).
Acceptance Criteria
Affected Contracts
order_handler, exchange_router
Summary
When a large market order would exceed the pool's available OI capacity (due to max_open_interest cap), the entire order currently reverts. A partial fill model would allow the order to execute up to the OI cap and queue the remainder.
Proposed Design
Add
allow_partial_fill: booltoCreateOrderParams.When
true:min(requested_size, remaining_oi_capacity)OrderPartiallyFilled { nonce, filled_size, remaining_size }When
false(default): current behaviour (revert if full size not fillable).Acceptance Criteria
allow_partial_fill = trueexecutes partial fill when OI cap is hitallow_partial_fill = falsestill reverts when OI cap reachedAffected Contracts
order_handler,exchange_router