Post Limit Order

Place a limit order

This mutation has been deprecated. Use the postProLimitOrder mutation instead to post limit orders.

A limit order is a type of order to buy or sell a cryptocurrency at your specified price or better.

Unlike market orders, limit orders are not executed instantly at the current market price. Limit orders are executed only when a market order equal to or better than the price you specified is received.

For buy limit orders, the order will only be executed when a seller is willing to sell to you at a price that is lower than or equal to your specified buy price. For sell limit orders, the order will only be executed when a buyer is willing to buy at a price that is higher than or equal to your specified sell price.

For example, if you place a limit order to buy bitcoin at the rate of N6,500,000 per bitcoin, your order will be fulfilled only for market orders that offer to sell at N6,500,000 or less .

When to place a limit order

Place a limit order when you want to specify a price and you do not need the order to execute instantly.

Static and dynamic prices

BuyCoins' API allows you to create limit orders that have either a static price or a dynamic price. Static prices are fixed, while dynamic prices automatically get updated to reflect changes to the price of the cryptocurrency.

The priceType parameter allows you to specify a price type when creating a limit order.

To keep dynamic prices updated, the latest dollar price of the cryptocurrency is periodically fetched from Bitstamp. Your order's price is then set to the product of the latest price and the dynamic exchange rate that you provided. i.e

dynamic price = latest cryptocurrency dollar price * your dollar to naira exchange rate

Current BuyCoins Price

You can find out the latest price of a cryptocurrency using the buycoinsPrices query.

query{
buycoinsPrices(side: buy, mode: standard, cryptocurrency: bitcoin){
buyPricePerCoin
cryptocurrency
id
maxBuy
maxSell
minBuy
minCoinAmount
minSell
mode
sellPricePerCoin
status
}
}

Dynamic Price Expiry

You can find out when next dynamic prices will be updated using the getOrders query. Refer to the Get Orders page for more details on getOrders.

query {
getOrders(status: open) {
dynamicPriceExpiry
}
}

Placing a limit order

You can place a limit order using the postLimitOrder mutation.

mutation {
postLimitOrder(orderSide: buy, coinAmount: 0.01, cryptocurrency: bitcoin, staticPrice: 6000000, priceType: static){
id
cryptocurrency
coinAmount
side
status
createdAt
pricePerCoin
priceType
staticPrice
dynamicExchangeRate
}
}

Parameters

  • orderSide: The order side either buy or sell

  • coinAmount: Amount of coins to trade

  • cryptocurrency: Type of cryptocurrency. default: bitcoin

  • priceType: The price type either static or dynamic

  • staticPrice: The static price in Naira (optional)

  • dynamicExchangeRate: The dynamic exchange rate in Naira (optional)

Response

  • id: Unique identifier of the order

  • 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

The status field returns the status of an order. A limit order can be either active or inactive. Only active orders can be executed.

You are allowed a maximum of 10 active limit orders. When you reach this limit any subsequent orders you create will be inactive.

Required fields based on price type

When priceType is static, staticPrice is required.

When priceType is dynamic , dynamicExchangeRate is required.