Book Manager
Clober’s orderbook contract adopts a monolithic design, where a single contract called BookManager
contains all the book instances. As a result, all orders, reserves, and states are managed within a single contract.
The major interfaces of the BookManager
are as follows:
- open: This creates a new Book instance within the
BookManager
. Note that this does not create a separate contract. It is configured through theBook
’s setting, known as theBookKey
. - make: This function places a new (bid-side) maker order on a designated Book.
- take: This function places a new (ask-side) taker order that consumes the counterparty maker orders at a specific tick on a designated
Book
. Note that technically it is possible to take from a non-top-of-the-book price, even though it is not reasonable to do so. - claim: When a maker order is filled, the user may call this function to receive the proceeds.
- cancel: Users may cancel their maker orders using this function.
Additional functions regarding the lock pattern will be discussed later.