Class RfqAuction
java.lang.Object
com.quantfinlib.rfq.RfqAuction
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
ConstructorsConstructorDescriptionRfqAuction(boolean clientBuys, double fairValue, int dealerCount, long requestNanos) -
Method Summary
Modifier and TypeMethodDescriptiondoubleThe best (dealable) price, NaN while nobody has quoted.booleandoubleThe cover: the second-best price — what the trade would have cost without the winner.intvoidonQuote(int dealer, double price, long timestampNanos) A dealer's quote.doublequote(int dealer) A dealer's standing quote (NaN = none/declined/pulled).intDealers with a standing quote right now (a small scan — panels are ~10).longresponseNanos(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).doublespreadToFairBps(double price) winnerSpreadToFairBps()for any price (e.g. a losing quote).intwinner()The winning dealer index, or -1 while nobody has quoted.doubleWhat the winning quote costs versus the model fair value, in bps of fair — positive = paying over theory (buys) / receiving under it (sells).
-
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 (butresponseNanos(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()
-