Module Algostream_order_management.Venue

Typed trading venue with fee tiers and supported order kinds.

Today the exchange field on Algostream_domain_orders.Order.order is just an untyped string. This module introduces a structured Venue.t consumed by the Routing layer — callers continue to set the exchange string on submitted orders for compatibility, but routing decisions are made against the typed value.

type fee_tier = {
  1. maker_bps : float;
  2. taker_bps : float;
  3. volume_threshold : float;
    (*

    monthly notional above which this tier applies (USD, asset-class native units)

    *)
}
type t = {
  1. name : string;
  2. asset_class : Asset.asset_class;
  3. fee_tiers : fee_tier list;
    (*

    sorted ascending by volume_threshold

    *)
  4. base_latency_us : float;
  5. supports_iceberg : bool;
  6. supports_stop : bool;
  7. min_order_size : float;
}
val create : name:string -> asset_class:Asset.asset_class -> fee_tiers:fee_tier list -> base_latency_us:float -> supports_iceberg:bool -> supports_stop:bool -> min_order_size:float -> t
val effective_fee_bps : t -> taker:bool -> monthly_volume:float -> float

Effective fee in basis points at the caller's monthly trading volume.

val supports : t -> kind:Order.order_type -> bool

Whether the venue supports the given order kind.

val binance_spot : t

Sensible defaults baked in, mirroring the per-exchange table in lib/normalization/symbol.ml. These are coarse approximations — verify against the venue's published schedule before routing real flow.

val coinbase_advanced : t