Class DarkPoolSimulator

java.lang.Object
com.quantfinlib.execution.DarkPoolSimulator

public final class DarkPoolSimulator extends Object
Midpoint-cross dark pool model: hidden resting orders match at the current lit-market midpoint, honoring minimum-execution-quantity constraints (a standard anti-gaming feature). No pre-trade transparency: resting interest is only observable through fills.
  • Constructor Details

    • DarkPoolSimulator

      public DarkPoolSimulator()
  • Method Details

    • onQuote

      public void onQuote(double bid, double ask)
      Update the lit reference mid. A LOCKED or CROSSED reference (bid >= ask) or a non-positive/non-finite side invalidates the mid: a real midpoint pool is prohibited from executing during a locked/crossed NBBO, so crossing pauses until a valid two-sided market returns — resting interest stays resting.
    • submit

      public List<DarkPoolSimulator.Fill> submit(Side side, long quantity, long minExecutionQty)
      Submits an order: crosses immediately against resting contra interest at the current mid (time priority), then rests the remainder. Returns the fills generated (empty if it fully rested).

      Minimum-execution-quantity is honored AGGREGATE-first, the common pool semantics: the incoming order's MEQ is checked against the total crossable contra quantity (an order wanting 100 fills against two resting 60s), while each resting order's own MEQ still gates its individual slice.

    • restingQty

      public long restingQty(Side side)
      Total hidden resting quantity on a side (for simulation introspection only).