Package velox.api.layer1
Interface Layer1ApiMboDataListener
- All Known Subinterfaces:
Layer1ApiAdapter,Layer1ApiListener,Layer1ApiMboDataAdapter,OnlineValueCalculatorAdapter,StrategyUpdateGenerator
- All Known Implementing Classes:
Layer1ApiDepthFreezer,Layer1ApiInjectorRelay,Layer1ApiRelay,Layer1ApiStrategiesEchoMessagesLayer,Layer1ApiUpstreamRelay
@DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
public interface Layer1ApiMboDataListener
Listener for MBO (market-by-order) events: individual resting orders in the book rather than aggregated price
levels.
Only instruments whose provider reports Layer1ApiProviderSupportedFeatures.mbo
produce these events.
Prices are in ticks, as in Layer1ApiDataListener.
When a provider supplies MBO but no MBP data, Bookmap derives Layer1ApiDataListener.onDepth(java.lang.String, boolean, int, int) updates
from these events, so an MBO instrument also receives depth callbacks.
Order ids are opaque strings unique within an instrument.
Bookmap keeps a per-instrument book keyed by id. A onMboReplace or onMboCancel for an unknown id,
or a onMboSend for an id that is already present, is a protocol violation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonMboCancel(String alias, String orderId) An order left the book, whether canceled or fully executed.voidonMboReplace(String alias, String orderId, int price, int size) An existing order changed its price and/or size.voidA new order entered the book.
-
Method Details
-
onMboSend
A new order entered the book.- Parameters:
alias- instrument aliasorderId- id of the order, unique within the instrumentisBid- true for a bid, false for an askprice- price in tickssize- order size
-
onMboReplace
An existing order changed its price and/or size. The side never changes. Bookmap keeps the order's queue position only when the price is unchanged and the size decreased. Any other change moves the order to the back of the queue at the new price.- Parameters:
alias- instrument aliasorderId- id of an order previously reported byonMboSend(String, String, boolean, int, int)price- new price in ticks (may equal the old one)size- new size (may equal the old one)
-
onMboCancel
An order left the book, whether canceled or fully executed. No further events for this id will follow unless it is re-sent.- Parameters:
alias- instrument aliasorderId- id of the removed order
-