Order Book Contract is the main contract responsible for holding all information regarding orders as well as executing those orders via the help of the Margin ledger.

Custom Structures


Struct Position is used to store data regarding the position.

Maker Order

Structure to store information about any Limit Order

View Methods


function fetchOrder(uint256 _orderId)

Returns the MakerOrderstructure for any given order ID.

Return Value : Maker Order


function getQuoteLot()

Returns the QuoteLot for the given market.


function fetchOrders(uint256[] _orderIds)

Returns the order structure for a given set of Order IDs.


function checkForAnyOpenOrder(address _user)

Returns trueif the address has any open limit order.

Write Methods


function addMakerOrder(bytes _orderData)

Function call to add a Limit order.

Ensure Sufficient Margin balance before calling this function!

Any given address can maintain a maximum of 5 limit orders at any point.

Params need to be encoded in the format :

Remove Order

function removeOrder(uint256 orderId)

Function to remove any given order using its unique order ID.

Ensure that the address sending the transaction is the maker of the given order


Remove Order By Address

function removeOrderByAddress(address maker)

Function to remove all orders for a given maker using his address.

Params :

Last updated