IOrderbook
This interface defines the functions that can be called on the Orderbook contract. These functions provide various operations related to initializing the orderbook, managing orders, retrieving orderbook information, and executing trades.
Functions
initialize
initialize
Initializes the orderbook with the specified ID, base asset, quote asset, and engine address.
Parameters
fpop
fpop
Removes and returns the first order from the orderbook at the specified price.
Parameters
Returns
setLmp
setLmp
Sets the last matched price (LMP) of the orderbook.
Parameters
mktPrice()
mktPrice()
Retrieves the market price of the orderbook.
Returns
assetValue
assetValue
Converts the specified amount of base or quote asset to its corresponding value in the other asset.
Parameters
Returns
isEmpty
isEmpty
Checks if the orderbook at the specified price is empty.
Parameters
Returns
getRequired
getRequired
Retrieves the required amount to execute the specified order at the given price.
Parameters
Returns
placeAsk
placeAsk
Places an ask order in the orderbook with the specified owner, price, and amount.
Parameters
placeBid
placeBid
Places a bid order in the orderbook with the specified owner, price, and amount.
Parameters
cancelOrder
cancelOrder
Cancels the specified order in the orderbook.
Parameters
Returns
execute
execute
Executes the specified order at the given price and amount.
Parameters
Returns
heads()
heads()
Retrieves the head of the bid and ask orderbooks.
Returns
askHead()
askHead()
Retrieves the head of the ask orderbook.
Returns
bidHead()
bidHead()
Retrieves the head of the bid orderbook.
Returns
getPrices
getPrices
Retrieves the prices from the orderbook.
Parameters
Returns
getOrders
getOrders
Retrieves the orders from the orderbook at the specified price.
Parameters
Returns
getOrder
getOrder
Retrieves the order from the orderbook with the specified ID.
Parameters
Returns
getOrderIds
getOrderIds
Retrieves the order IDs from the orderbook at the specified price.
Parameters
Returns
Last updated