Module Trading_engine.Market_event

Causally observable quote and trade events.

type aggressor_side =
  1. | Buy
  2. | Sell
  3. | Unknown
type kind =
  1. | Quote of {
    1. bid_price : Scalar.Price.t;
    2. bid_quantity : Scalar.Quantity.t;
    3. ask_price : Scalar.Price.t;
    4. ask_quantity : Scalar.Quantity.t;
    }
  2. | Trade of {
    1. price : Scalar.Price.t;
    2. quantity : Scalar.Quantity.t;
    3. aggressor_side : aggressor_side;
    }
type t = private {
  1. instrument_id : Id.Instrument.t;
  2. event_at : Ptime.t;
  3. available_at : Ptime.t;
  4. received_at : Ptime.t;
  5. ingest_sequence : int64;
  6. kind : kind;
}
val quote : instrument_id:Id.Instrument.t -> event_at:Ptime.t -> available_at:Ptime.t -> received_at:Ptime.t -> ingest_sequence:int64 -> bid_price:Scalar.Price.t -> bid_quantity:Scalar.Quantity.t -> ask_price:Scalar.Price.t -> ask_quantity:Scalar.Quantity.t -> (t, string) Stdlib.result
val trade : instrument_id:Id.Instrument.t -> event_at:Ptime.t -> available_at:Ptime.t -> received_at:Ptime.t -> ingest_sequence:int64 -> price:Scalar.Price.t -> quantity:Scalar.Quantity.t -> aggressor_side:aggressor_side -> (t, string) Stdlib.result
val compare_replay_order : t -> t -> int
val aggressor_side_to_string : aggressor_side -> string
val aggressor_side_of_string : string -> (aggressor_side, string) Stdlib.result