Skip to main content

Module order_status_materialization

Module order_status_materialization 

Source
Expand description

Materialized order state management.

Keeps order_infos.status and order_infos.filled_size in sync with the latest order_updates row. Terminal statuses (CANCELED, FILLED, REJECTED) are never overwritten by earlier updates.

Constantsยง

TERMINAL_ORDER_STATUSES ๐Ÿ”’

Functionsยง

is_terminal_order_status ๐Ÿ”’
update_existing_materialized_order_state_if_newer
upsert_materialized_order_state
Upsert the materialized order_infos row with the latest status and filled_size. Skips the update if the existing row is already terminal or has a newer last_materialized_order_update_id.