Skip to main content

Module event_handler

Module event_handler 

Source
Expand description

Engine event handler: persists EngineMessage variants to Postgres.

This module contains the core event-to-SQL logic that was previously embedded in the root crate’s DieselEventHandler. It operates on a bare &mut PgConnection so callers can wrap calls in their own transactions.

StructsΒ§

ExpiredOrderCancel
Portable representation of an expired order that needs a synthetic cancel.
FillSideEffect
Journal-only accounting deltas for a single OrderFilled event.

EnumsΒ§

FillUnderlyingNotionalValidation πŸ”’

FunctionsΒ§

apply_fill_ledger_side_effects πŸ”’
liquidation_auction_from_status πŸ”’
liquidation_auction_update_from_message πŸ”’
liquidation_history_from_message πŸ”’
new_liquidation_state_from_domain πŸ”’
Convert a domain LiquidationStateRecord into the Diesel NewLiquidationState insertable.
persist_fill_with_side_effects_in_tx
Persist a fill (trade + taker/maker fill rows) and apply ledger side effects in the caller’s transaction.
persist_fill_with_side_effects_in_tx_with_validation πŸ”’
persist_legacy_replay_fill_with_side_effects_in_tx
Persist a journaled fill while preserving replay compatibility for pre-cutover WAL payloads that did not carry underlying_notional.
status_to_liquidation_state_record
Convert an AccountLiquidationStatus to a LiquidationStateRecord for database storage.
validate_fill_underlying_notional πŸ”’