Class Auction

java.lang.Object
com.quantfinlib.microstructure.Auction

public final class Auction extends Object
A call auction (open/close/volatility uncross): orders accumulate without trading, then a single clearing price executes the maximum matchable volume — the mechanism behind exchange opens, the close every benchmark-tracking strategy trades, and LULD/volatility-halt reopenings.

Price discovery follows the standard exchange rulebook hierarchy:

  1. Maximum executable volume — the price(s) where cumulative eligible buys meet cumulative eligible sells;
  2. Minimum surplus — among volume ties, the price leaving the smallest unfilled imbalance;
  3. Reference proximity — among remaining ties, closest to the reference price (typically the last traded price).

Market orders are always eligible on their side. The indicative price / volume / imbalance triple — what venues disseminate during the call phase — is exposed via indicative(double), and uncross(double) additionally reports the surplus side. Not thread-safe; an auction is single-threaded by nature (one uncross event).

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Auction outcome: clearing price, matched volume, and leftover imbalance.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addBuy(double limitPrice, long quantity)
    Adds a buy limit order to the call book.
    addMarketBuy(long quantity)
    Adds a market-on-auction buy (eligible at any clearing price).
    addMarketSell(long quantity)
    Adds a market-on-auction sell.
    addSell(double limitPrice, long quantity)
    Adds a sell limit order to the call book.
    indicative(double referencePrice)
    The indicative uncross the venue would disseminate right now, or null when no price can match any volume (crossed side empty or book entirely uncrossed).
    uncross(double referencePrice)
    Runs the auction: the indicative at this instant becomes the print.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Auction

      public Auction()
  • Method Details

    • addBuy

      public Auction addBuy(double limitPrice, long quantity)
      Adds a buy limit order to the call book.
    • addSell

      public Auction addSell(double limitPrice, long quantity)
      Adds a sell limit order to the call book.
    • addMarketBuy

      public Auction addMarketBuy(long quantity)
      Adds a market-on-auction buy (eligible at any clearing price).
    • addMarketSell

      public Auction addMarketSell(long quantity)
      Adds a market-on-auction sell.
    • indicative

      public Auction.Result indicative(double referencePrice)
      The indicative uncross the venue would disseminate right now, or null when no price can match any volume (crossed side empty or book entirely uncrossed).
    • uncross

      public Auction.Result uncross(double referencePrice)
      Runs the auction: the indicative at this instant becomes the print. The book is left untouched (venues re-open continuous trading with residuals; callers can rebuild as needed).