Get Market Book

Retrieve the market book

This query has been deprecated. Read about how to stream our orderbook instead.

The market book is a list of orders on the BuyCoins P2P platform. You can view the market book using the getMarketBook query.

query {
getMarketBook {
dynamicPriceExpiry
orders {
edges {
node {
id
cryptocurrency
coinAmount
side
status
createdAt
pricePerCoin
priceType
staticPrice
dynamicExchangeRate
}
}
}
}
}
‚Äč

getMarketBook returns two root fields: dynamicPriceExpiry and orders.

Dynamic prices are updated periodically in line with the fluctuations in the general prices of cryptocurrencies. dynamicPriceExpiry gives the timestamp when all dynamic prices will next be updated to the reflect the latest cryptocurrency prices.

For more details about dynamic price and how they are fetched and calculated, please refer to the Static and dynamic prices section on the Post Limit Order page.

The orders field is a graphql connection that returns the orders on the market book, including fields like cryptocurrency, side, and pricePerCoin for each order.

Parameters

  • status: The status of orders to fetch, either open or completed.

Response

  • dynamicPriceExpiry: The timestamp of the dynamic price update

  • orders: A graphql connection returning a list of orders

Order response fields:

  • id: Unique identifier of the order

  • cryptocurrency: Type of cryptocurrency

  • coinAmount: Amount of coins to trade

  • pricePerCoin: The price per coin in Naira

  • side: The order side (buy or sell)

  • status: The status of the order

  • createdAt: The timestamp when the order was created

  • staticPrice: The static price in Naira

  • priceType: The price type either static or dynamic

  • dynamicExchangeRate: The dynamic exchange rate in Naira