# Market Interface
# 1. Market Pair Information
HTTP Request
# Request
GET /rank/all
example: https://bydfi.com/b2b/rank/all
description: market data for all tickers and all markets.
response description
Name | Type | Status | Description |
---|---|---|---|
code | code | Mandatory | Status code Note:200 means success and other means failure |
msg | String | Mandatory | Prompt information |
trading_pairs | string | Mandatory | Identifier of a ticker with delimiter to separate base/quote, eg. BTC-USD (Price of BTC is quoted in USD) |
base_Id | string | Mandatory | Symbol/currency ID of base pair |
quote_id | string | Mandatory | Symbol/currency ID of base pair |
base_currency | string | Mandatory | Symbol/currency code of base pair, eg. BTC |
quote_currency | string | Mandatory | Symbol/currency code of quote pair, eg. ETH |
last_price | decimal | Mandatory | Last transacted price of base currency based on given quote currency |
lowest_ask | decimal | Mandatory | Lowest Ask price of base currency based on given quote currency |
highest_bid | decimal | Mandatory | Highest bid price of base currency based on given quote currency |
base_volume | decimal | Mandatory | 24-hr volume of market pair denoted in BASE currency |
quote_volume | decimal | Mandatory | 24-hr volume of market pair denoted in QUOTE currency |
price_change_percent_24h | decimal | Mandatory | 24-hr % price change of market pair |
highest_price_24h | decimal | Mandatory | Highest price of base currency based on given quote currency in the last 24-hrs |
lowest_price_24h | decimal | Mandatory | Lowest price of base currency based on given quote currency in the last 24-hrs |
# Response
{
"code": 200,
"msg": "success",
"data":{
"YFI_USDT":{
"base_currency":"YFI",
"base_id":"2",
"quote_id":"1",
"base_volume":"47115.0",
"highest_bid":"47115.0",
"highest_price_24h":"47115.0",
"last_price":"47115.0",
"lowest_ask":"47115.0",
"lowest_price_24h":"47115.0",
"price_change_percent_24h":"-11.41513677811",
"quote_currency":"USDT",
"quote_volume":"47115.0",
"trading_pairs":"YFI_USDT"
}
}
}
# 2. Get Market Depth
HTTP Request
# Request
GET /rank/orderbook
example: https://bydfi.com/b2b/rank/orderbook
description: full depth returned for a given market pair
request Paramters
name | Type | Status | description |
---|---|---|---|
market_pair | string | Mandatory | A pair such as “LTC_BTC” |
depth | string | Recommended | Orders depth quantity: [0,5,10,20,50,100,500]. Default depth=100 |
Response description
name | Type | Status | description |
---|---|---|---|
ticker_id | string | Mandatory | A pair such as "LTC_BTC", with delimiter between different cryptoassets |
timestamp | Integer | Mandatory | Unix timestamp in milliseconds for when the last updated time occurred. |
amount | decimal | Mandatory | An array containing 2 elements. The offer price and quantity fyor each bid order |
price | decimal | Mandatory | An array containing 2 elements. The ask price and quantity for each ask order |
# Response
{
"code": 200,
"msg": "success",
"data":{
"ticker_id": BTC_USDT,
"asks": [{
"amount": 1000,
"price": "50000.18"
} ],
"bids":[{
"amount": 1000,
"price": "50000.18"
}]
}
}
# 3. Summary for each currency
HTTP Request
# Request
GET /rank/asset
example: https://bydfi.com/b2b/rank/asset
description: The assets endpoint is to provide a detailed summary for each currency available on the exchange.
Response description
name | Type | Status | description |
---|---|---|---|
name | string | Mandatory | Full name of cryptocurrency. |
can_withdraw | decimal | Mandatory | Identifies whether withdrawals are enabled or disabled. |
can_deposit | decimal | Mandatory | Identifies whether deposits are enabled or disabled |
min_withdraw | decimal | Mandatory | Identifies the single minimum withdrawal amount of a cryptocurrency. |
max_withdraw | decimal | Mandatory | Identifies the single maximum withdrawal amount of a cryptocurrency. |
maker_fee | decimal | Recommended | Fees applied when liquidity is added to the order book. |
taker_fee | decimal | Recommended | Fees applied when liquidity is added to the order book. |
# Response
{
"code": 200,
"msg": "success",
"data":{
"YFI_USDT":{
"unified_cryptoasset_id":"123",
"can_deposit":"false",
"can_withdraw":"true",
"maker_fee":0.0001,
"max_withdraw":"47115.0",
"min_withdraw":"47115.0",
"name":"BTC",
"taker_fee":0.0001,
}
}
}
# 4.24-hour pricing for each market pair
HTTP Request
# Request
GET /rank/ticker
example: https://bydfi.com/b2b/rank/ticker
description:The ticker endpoint is to provide a 24-hour pricing and volume summary for each market pair available on the exchange
Response description
name | Type | Status | description |
---|---|---|---|
base_id | integer | Recommended | The quote pair Unified Cryptoasset ID. |
quote_id | Integer | Mandatory | The base pair Unified Cryptoasset ID. |
last_price | decimal | Mandatory | Last transacted price of base currency based on given quote currency. |
base_volume | decimal | Mandatory | 24-hour trading volume denoted in BASE currenc |
quote_volume | decimal | Mandatory | 24 hour trading volume denoted in QUOTE currency |
isFrozen | decimal | Mandatory | Indicates if the market is currently enabled (0) or disabled (1) |
# Response
{
"code": 200,
"msg": "success",
"data":{
"YFI_USDT":{
"base_volume":"446.50222",
"isFrozen":1,
"last_price":31068.48,
"quote_id":null,
"quote_volume":"14415429.6967232"
}
}
}
# 5. Get history order
HTTP Request
# Request
GET /rank/trades
example: https://bydfi.com/b2b/rank/trades
description:The trades endpoint is to return data on all recently completed trades for a given market pair
request description
name | Type | Status | description |
---|---|---|---|
market_pair | string | Mandatory | A pair such as LTC_BTC. |
response description
name | Type | Status | description |
---|---|---|---|
trade_id | integer | Mandatory | A unique ID associated with the trade for the currency pair transactio |
price | decimal | Mandatory | Last transacted price of base currency based on given quote currency |
base_volume | decimal | Mandatory | Transaction amount in BASE currency. |
quote_volume | decimal | Mandatory | Transaction amount in QUOTE currency |
timestamp | decimal | Mandatory | Unix timestamp in milliseconds for when the transaction occurred. |
type | string | Mandatory | Used to determine whether or not the transaction originated as a buy or sel |
# Response
{
"code": 200,
"msg": "success",
"data":[{
"trade_id":"3523643",
"price":0.01,
"base_volume":569000,
"quote_volume":0.01000000,
"timestamp":1585177482652,
"type":"sell"
}]
}
}