Class RfqAuction

java.lang.Object
com.quantfinlib.rfq.RfqAuction

public final class RfqAuction extends Object
One request-for-quote auction — how equity derivatives actually trade. Structured products (autocallables, exotic options) have no order book: the buy-side sends an RFQ to a panel of dealers, collects quotes for a window, and deals on the best — while recording the cover (second-best) price, the industry's standard measure of how much the winner's edge was worth and the input every dealer-selection model feeds on.

Prices are for ONE unit of the instrument in the client's direction: for a client BUY, lower is better; for a SELL, higher. Anchor the auction with the model fair value (e.g. pricing.Autocallable.price) and winnerSpreadToFairBps() reports what was paid versus theory — the number that goes into RfqDealerScorecard. Fixed dealer panel (dense indices), no allocation after construction, single writer per auction; auctions are cheap and short-lived (one per RFQ).

  • Constructor Summary

    Constructors
    Constructor
    Description
    RfqAuction(boolean clientBuys, double fairValue, int dealerCount, long requestNanos)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    The best (dealable) price, NaN while nobody has quoted.
    boolean
     
    double
    The cover: the second-best price — what the trade would have cost without the winner.
    int
     
    void
    onQuote(int dealer, double price, long timestampNanos)
    A dealer's quote.
    double
    quote(int dealer)
    A dealer's standing quote (NaN = none/declined/pulled).
    int
    Dealers with a standing quote right now (a small scan — panels are ~10).
    long
    responseNanos(int dealer)
    Time from the request to this dealer's FIRST response, or -1 if the dealer never quoted this auction (a later pull does not erase that they showed up).
    double
    spreadToFairBps(double price)
    winnerSpreadToFairBps() for any price (e.g. a losing quote).
    int
    The winning dealer index, or -1 while nobody has quoted.
    double
    What the winning quote costs versus the model fair value, in bps of fair — positive = paying over theory (buys) / receiving under it (sells).

    Methods inherited from class java.lang.Object

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

    • RfqAuction

      public RfqAuction(boolean clientBuys, double fairValue, int dealerCount, long requestNanos)
      Parameters:
      clientBuys - the client's direction (buy = pay the price)
      fairValue - the model anchor price (NaN = no anchor; spreads to fair read NaN)
      dealerCount - panel size (dense dealer indices)
      requestNanos - when the RFQ went out (response times measure from here)
  • Method Details

    • onQuote

      public void onQuote(int dealer, double price, long timestampNanos)
      A dealer's quote. A dealer may refresh; the LAST price stands (but responseNanos(int) keeps the FIRST response — a dealer who showed up in 50ms and refreshed near the close is a fast responder, not a slow one). Non-positive or non-finite prices are declines — recorded as no quote, never as a tradable level; an explicit pull withdraws a standing quote.
    • winner

      public int winner()
      The winning dealer index, or -1 while nobody has quoted.
    • bestPrice

      public double bestPrice()
      The best (dealable) price, NaN while nobody has quoted.
    • coverPrice

      public double coverPrice()
      The cover: the second-best price — what the trade would have cost without the winner. NaN with fewer than two quotes. The classic dealer-performance yardstick: a winner far inside the cover left nothing on the table; a winner AT the cover was replaceable.
    • winnerSpreadToFairBps

      public double winnerSpreadToFairBps()
      What the winning quote costs versus the model fair value, in bps of fair — positive = paying over theory (buys) / receiving under it (sells). NaN without a winner or a fair-value anchor.
    • spreadToFairBps

      public double spreadToFairBps(double price)
      winnerSpreadToFairBps() for any price (e.g. a losing quote).
    • responseNanos

      public long responseNanos(int dealer)
      Time from the request to this dealer's FIRST response, or -1 if the dealer never quoted this auction (a later pull does not erase that they showed up).
    • quote

      public double quote(int dealer)
      A dealer's standing quote (NaN = none/declined/pulled).
    • quoteCount

      public int quoteCount()
      Dealers with a standing quote right now (a small scan — panels are ~10).
    • dealerCount

      public int dealerCount()
    • clientBuys

      public boolean clientBuys()