NAV Navbar
Logo
shell

Introduction

Welcome to Busha Pro trader and developer documentation. These documents outline exchange functionality, market details, and APIs.

APIs are separated into two categories: trading and feed. Trading APIs require authentication and provide access to placing orders and other account information. Feed APIs provide market data and are public.

General

Market overview and general information.

Matching Engine

Busha Pro operates a continuous first-come, first-serve order book. Orders are executed in price-time priority as received by the matching engine.

Self-Trade Prevention

Self-trading is not allowed on Busha Pro. Two orders from the same user will not fill one another. When placing an order, you can specify the self-trade prevention behavior.

DECREMENT AND CANCEL

The default behavior is decrement and cancel. When two orders from the same user cross, the smaller order will be canceled and the larger order size will be decremented by the smaller order size. If the two orders are the same size, both will be canceled.

CANCEL OLDEST

Cancel the older (resting) order in full. The new order continues to execute.

CANCEL NEWEST

Cancel the newer (taking) order in full. The old resting order remains on the order book.

CANCEL BOTH

Immediately cancel both orders.

NOTES FOR MARKET ORDERS

When a market order using dc self-trade prevention encounters an open limit order, the behavior depends on which fields for the market order message were specified. If funds and size are specified for a buy order, then size for the market order will be decremented internally within the matching engine and funds will remain unchanged. The intent is to offset your target size without limiting your buying power. If size is not specified, then funds will be decremented. For a market sell, the size will be decremented when encountering existing limit orders.

Price Improvement

Orders are matched against existing order book orders at the price of the order on the book, not at the price of the taker order.

EXAMPLE

User A places a Buy order for 1 BTC at 100 NGN. User B then wishes to sell 1 BTC at 80 NGN. Because User A’s order was first to the trading engine, they will have price priority and the trade will occur at 100 NGN.

Order Lifecycle

Valid orders sent to the matching engine are confirmed immediately and are in the received state. If an order executes against another order immediately, the order is considered done. An order can execute in part or whole. Any part of the order not filled immediately, will be considered open. Orders will stay in the open state until canceled or subsequently filled by new orders. Orders that are no longer eligible for matching (filled or canceled) are in the done state.

Fees

Trading Fees

Busha Pro operates a maker-taker model. Orders which provide liquidity are charged different fees from orders taking liquidity. The fee is assessed as a percentage of the match amount (price * size). Maker and taker fees are calculated hourly based on the user’s 30d NGN-equivalent trading volume:

User 30 day BTC volume Take fee Maker fee
>BTC 0.00* 1.00% 0.00%
>BTC 10.00* 0.75% 0.00%
>BTC 100.00* 0.5% 0.00%

HOW TAKER FEES ARE CALCULATED

Your taker fee is based upon total BTC trading volume across all Order Books over the trailing 30 day period. For example, a purchase of 1 BTC on the BTC-NGN book will count as 1 BTC towards your 30 day BTC volume.

HOW VOLUMES ARE CALCULATED ON NON-USD BOOKS

Transactions made on non-BTC books are converted to BTC based on the most recent fill price on the corresponding BTC book. For example, a purchase of 1 ETH for 0.1 RMT on the ETH-RMT book will count as the most recent fill price of 1 ETH on the ETH-RMT Order Book.

Requests

All requests and responses are application/json content type and follow typical HTTP response status codes for success and failure.

Errors

Example error response:


{
    "message": "Invalid Price"
}

Unless otherwise stated, errors to bad requests will respond with HTTP 4xx or status codes. The body will also contain a message parameter indicating the cause. Your language’s http library should be configured to provide message bodies for non-2xx requests so that you can read the message field from the body.

Common error codes

Error Code Meaning
400 Bad Request – Invalid request format
401 Unauthorized – Invalid API Key
403 Forbidden – Forbidden – You do not have access to the requested resource
404 Not Found
405 Method Not Allowed
429 Too Many Requests – You’re requesting too many kittens! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.

Success

A successful response is indicated by HTTP status code 200 and may contain an optional body. If the response has a body it will be documented under each resource below.

Types

Timestamps

2014-11-06T10:34:47.123456Z

Unless otherwise specified, all timestamps from API are returned in ISO 8601 with microseconds. Make sure you can parse the following ISO 8601 format. Most modern languages and libraries will handle this without issues.

Numbers

Decimal numbers are returned as strings to preserve full precision across platforms. When making a request, it is recommended that you also convert your numbers to strings to avoid truncation and precision errors.

Integer numbers (like trade id and sequence) are unquoted.

IDs

132fb6ae-456b-4654-b4e0-d681ac05cea1 or 132fb6ae456b4654b4e0d681ac05cea1

Most identifiers are UUID unless otherwise specified. When making a request which requires a UUID, both forms (with and without dashes) are accepted.

Rate Limits

When a rate limit is exceeded, a status of 429 Too Many Requests will be returned.

Calls to the Market Data APIs are rate limited to 1 call per second per IP address. All other API calls are rate limited to 1 call per second per customer. API call rate limits allow bursts of up to five consecutive calls.

Market Data

The Market Data API is an unauthenticated set of endpoints for retrieving market data. These endpoints provide snapshots of market data.

Products

Get Products

Get a list of available currency pairs for trading.

HTTP Request

curl --request GET \
  --url https://api.pro.busha.co/api/v1/products/ 

The above command returns JSON structured like this:

[
    {
        "id": "BTC-NGN",
        "base_currency": "BTC",
        "quote_currency": "NGN",
        "base_min_size": "0.0005",
        "base_max_size": "1000.00"
    }
]

GET /api/v1/products/

DETAILS

The base_min_size and base_max_size fields define the min and max order size.

Get Product Order Book

Get a list of open orders for a product. The amount of detail shown can be customized with the level parameter.

HTTP REQUEST

curl --request GET \
  --url https://api.pro.busha.co/api/v1/products/BTC-NGN/book/ 

The above command returns JSON structured like this:

{
    "sequence": 7209957995,
    "bids": [
        {
            "price": "2230289",
            "size": "0.001",
            "num_orders": "1"
        }
    ],
    "asks": [
        {
            "price": "2230290",
            "size": "0.001",
            "num_orders": "5"
        }
    ]
}

GET /products/<product-id>/book

DETAILS

By default, only the inside (i.e. best) bid and ask are returned. This is equivalent to a book depth of 1 level. If you would like to see a larger order book, specify the level query parameter.

If a level is not aggregated, then all of the orders at each price will be returned. Aggregated levels return only one size for each active price (as if there was only a single order for that size at the level).

PARAMETERS

Name Default Description
level 1 Select response detail. Valid levels are documented below
curl --request GET \
  --url https://api.pro.busha.co/api/v1/products/BTC-NGN/book/?level=2

The above command returns JSON structured like this:

{
    "sequence": 7209957995,
    "bids": [
        {
            "price": "2230289",
            "size": "2.0",
            "num_orders": "1"
        },
        {
            "price": "2230280",
            "size": "0.5",
            "num_orders": "3"
        },
        ...
    ],
    "asks": [
        {
            "price": "2230290",
            "size": "0.001",
            "num_orders": "5"
        },
        {
            "price": "2230288",
            "size": "0.1",
            "num_orders": "8"
        },
        ...
    ]
}

LEVELS

Level Description
1 Only the best bid and ask
2 Top 50 bids and asks (aggregated)
3 Full order book (non aggregated)

Levels 1 and 2 are aggregated. The size field is the sum of the size of the orders at that price, and num-orders is the count of orders at that price, size should not be multiplied by num-orders.

Level 3 is non-aggregated and returns the entire order book.

Get Product Ticker

Snapshot information about the last trade (tick), best bid/ask and 24h volume. price and size represents the last trade price and size.

HTTP REQUEST

curl --request GET \
  --url https://api.pro.busha.co/api/v1/products/BTC-NGN/ticker/

The above command returns JSON structured like this:

{
    "trade_id": 52743869,
    "price": "2290999.00",
    "size": "0.01187951",
    "bid": "2290999.00",
    "ask": "2291000.00",
    "volume": "16.363885",
    "time": "2018-10-21T10:33:43.802000Z"
}

GET /products/<product-id>/ticker

Get Trades

List the latest trades for a product.

HTTP REQUEST

curl --request GET \
  --url https://api.pro.busha.co/api/v1/products/BTC-NGN/trades/
[{
    "time": "2014-11-07T22:19:28.578544Z",
    "trade_id": 74,
    "price": "2291000.00",
    "size": "0.01000000",
    "side": "buy"
}, {
    "time": "2014-11-07T01:08:43.642366Z",
    "trade_id": 73,
    "price": "2290999",
    "size": "0.002137",
    "side": "sell"
}]

GET /products/<product-id>/trades

SIDE

The trade side indicates the maker order side. The maker order is the order that was open on the order book. buy side indicates a down-tick because the maker was a buy order and their order was removed. Conversely, sell side indicates an up-tick.