Orderbook

State Variables

Functions

initialize

Initializes the orderbook contract with the provided parameters.

Parameters

setLmp

Sets the last matched price in the price linked list.

Parameters

placeAsk

Places an ask order in the orderbook.

Parameters

placeBid

Places a bid order in the orderbook.

Parameters

cancelOrder

Cancels an order from the orderbook.

Parameters

Returns

execute

Executes an order from the orderbook.

Parameters

Returns

fpop

Pops the first order with the given price from the orderbook.

Parameters

Returns

getRequired

Retrieves the required amount for executing the order.

Parameters

Returns

heads()

Retrieves the head prices of the bid and ask lists.

Returns

askHead()

Retrieves the head price of the ask list.

Returns

bidHead()

Retrieves the head price of the bid list.

Returns

mktPrice()

Retrieves the market's last matched price.

Returns

getPrices

Retrieves the prices from the bid or ask list.

Parameters

Returns

getOrderIds

Retrieves the order IDs at a specific price from the bid or ask list.

Parameters

Returns

getOrders

Retrieves the orders at a specific price from the bid or ask list.

Parameters

Returns

getOrder

Retrieves a specific order from the bid or ask list.

Parameters

Returns

assetValue

Retrieves the asset value in the quote asset if isBid is true, otherwise retrieves the asset value in the base asset.

Parameters

Returns

Last updated