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

Initializes the orderbook with the specified ID, base asset, quote asset, and engine address.

Parameters

fpop

Removes and returns the first order from the orderbook at the specified price.

Parameters

Returns

setLmp

Sets the last matched price (LMP) of the orderbook.

Parameters

mktPrice()

Retrieves the market price of the orderbook.

Returns

assetValue

Converts the specified amount of base or quote asset to its corresponding value in the other asset.

Parameters

Returns

isEmpty

Checks if the orderbook at the specified price is empty.

Parameters

Returns

getRequired

Retrieves the required amount to execute the specified order at the given price.

Parameters

Returns

placeAsk

Places an ask order in the orderbook with the specified owner, price, and amount.

Parameters

placeBid

Places a bid order in the orderbook with the specified owner, price, and amount.

Parameters

cancelOrder

Cancels the specified order in the orderbook.

Parameters

Returns

execute

Executes the specified order at the given price and amount.

Parameters

Returns

heads()

Retrieves the head of the bid and ask orderbooks.

Returns

askHead()

Retrieves the head of the ask orderbook.

Returns

bidHead()

Retrieves the head of the bid orderbook.

Returns

getPrices

Retrieves the prices from the orderbook.

Parameters

Returns

getOrders

Retrieves the orders from the orderbook at the specified price.

Parameters

Returns

getOrder

Retrieves the order from the orderbook with the specified ID.

Parameters

Returns

getOrderIds

Retrieves the order IDs from the orderbook at the specified price.

Parameters

Returns

Last updated