Methods for managing markets
On this page:
POST[host]/back-api/backoffice/market |
|
PUT[host]/back-api/backoffice/market/{market_id} |
|
GET[host]/back-api/backoffice/markets/available-assets |
Add a new market
Use this method to add a new market (currency pair) to the exchange.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- id string
The market identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- base_asset string
The base asset (or transaction currency), which is the first currency appearing in a currency pair.
- quote_asset string
The quote asset, which is the second currency appearing in a currency pair (both direct and indirect). It is used to determine the value of a base asset.
- amount_scale integer
The maximum number of decimal places allowed for representing asset amounts on a market. This value also determines the minimum amount that can be traded on a market.
Typically, the amount scale is equal to the
scale
specified for a base asset in a pair.This value cannot exceed the scale of a base asset and must be within 2–18 range.
- min_amount number
The minimum amount that can be traded on a market.
Orders with a lesser amount are rejected.
- price_deviation number
The allowed price deviation for limit orders placed on a market.
When the requested price deviates too much from the best bid or ask prices, exceeding the limit defined by this parameter, an order is rejected.
This value is normalized to 0–1 range: for example, 0.15 indicates the allowed deviation of 15%.
- price_scale integer
The maximum number of decimal places allowed for representing asset prices. This value also determines the minimum amount that can be traded on a market.
Typically, the price scale is equal to the
scale
specified for a quote asset in a pair.This value cannot exceed the scale of a quote asset and must be within 2–18 range.
- max_price number
The maximum allowed price for assets traded on a market.
- min_price number
The minimum allowed price for assets traded on a market.
- base_fee number
The fee charged for a base asset traded on a market.
- quote_fee number
The fee charged for a quote asset traded on a market.
- maker_fee number
The fee charged for orders placed by market makers providing liquidity to a market.
This value is normalized to 0–1 range: for example, 0.05 indicates a fee of 5%. A maker fee of 5% is considered substantial and may be detrimental to business.
- taker_fee number
The fee charged for orders placed by market takers diminishing market liquidity.
This value is normalized to 0–1 range: for example, 0.05 indicates a fee of 5%. A taker fee of 5% is considered substantial and may be detrimental to business.
- status string
The market status indicating whether new orders can be placed on a market:
Open
— new orders can be placed on a market using the UI or APIPaused
— order placement requests made using the UI or API are rejected on a market (previously placed limit orders still await execution as per their time-in-force settings)Halted
— new orders cannot be placed on a market using the UI or API
For newly created markets,
status
is always set toHalted
.To allow trading on a created market, use a separate method to update market settings with the
status
parameter set toOpen
.- side string
The market side. Possible values:
BuySell
Buy
Sell
POST[host]/back-api/backoffice/market/
POST /back-api/backoffice/market HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g
{
"id": "btc_usdt",
"base_asset": "btc",
"quote_asset": "usdt",
"amount_scale": 8,
"min_amount": 1.0,
"price_deviation": 0.1,
"price_scale": 8,
"max_price": 0,
"min_price": 0,
"base_fee": 0,
"quote_fee": 0,
"maker_fee": 0.002,
"taker_fee": 0.002,
"status": "Halted", // optional, always Halted
"side": "BuySell"
}
Response
In case of success, HTTP code 200
is returned.
Update market settings
Use this method to customize an existing market.
Important
This operation can be performed only by users assigned the Admin role.
Users with the Support role can only update the Hidden
field value.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- market_id required
The market identifier (corresponds to the
id
parameter value specified when adding a market).
Body:
- base_fee number
The fee charged for a base asset traded on a market.
- quote_fee number
The fee charged for a quote asset traded on a market.
- maker_fee number
The fee charged for orders placed by market makers providing liquidity to a market.
This value is normalized to 0–1 range: for example, 0.05 indicates a fee of 5%. A maker fee of 5% is considered substantial and may be detrimental to business.
- taker_fee number
The fee charged for orders placed by market takers diminishing market liquidity.
This value is normalized to 0–1 range: for example, 0.05 indicates a fee of 5%. A taker fee of 5% is considered substantial and may be detrimental to business.
- hidden boolean
If
true
, a market is not available to exchange users.- price_scale integer
The maximum number of decimal places allowed for representing asset prices. This value also determines the minimum amount that can be traded on a market.
Typically, the price scale is equal to the
scale
specified for a quote asset in a pair.This value cannot exceed the scale of a quote asset and must be within 2–18 range.
- amount_scale integer
The maximum number of decimal places allowed for representing asset amounts on a market. This value also determines the minimum amount that can be traded on a market.
Typically, the amount scale is equal to the
scale
specified for a base asset in a pair.This value cannot exceed the scale of a base asset and must be within 2–18 range.
- status string
The market status indicating whether new orders can be placed on a market:
Open
— new orders can be placed on a market using the UI or APIPaused
— order placement requests made using the UI or API are rejected on a market (previously placed limit orders still await execution as per their time-in-force settings)Halted
— new orders cannot be placed on a market using the UI or API
For newly created markets,
status
is always set toHalted
.To change the market status, specify the
status
parameter in a separate method call to avoid possible errors.- side string
The market side. Possible values:
BuySell
Buy
Sell
- min_amount number
The minimum amount that can be traded on a market.
Orders with a lesser amount are rejected.
- price_deviation number
The allowed price deviation for limit orders placed on a market.
When the requested price deviates too much from the best bid or ask prices, exceeding the limit defined by this parameter, an order is rejected.
This value is normalized to 0–1 range: for example, 0.15 indicates the allowed deviation of 15%.
PUT[host]/back-api/backoffice/market/{market_id}
PUT /back-api/backoffice/market/btc_usdt HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g
{
"base_fee": 0.0025,
"quote_fee": 0.0025,
"maker_fee": 0.0025,
"taker_fee": 0.0028,
"hidden": false,
"price_scale": 8,
"amount_scale": 8,
"status": "Open",
"side": "BuySell",
"min_amount": 1.0,
"price_deviation": 0.1
}
Response
In case of success, HTTP code 200
is returned.
Note
Users with the Support role can only update the Hidden
field value.
Upon attempting to customize other fields, the Forbidden status is returned, along with the name of the first encountered field that is not allowed to be changed. In this case, the new value specified for the Hidden field in this request is not applied as well.
Get the available currency pairs
Use this method to get a list of assets and currency pairs that are supported for markets available on the exchange.
Request
Header parameters:
Authorization: Bearer <access_token>
GET[host]/back-api/backoffice/markets/available-assets
GET /back-api/backoffice/markets/available-assets HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g
Response
The response includes the following fields:
- assetInfos array
An array of string values indicating the requested assets.
- id string
The asset identifier (such as
btc
).- name string
The full asset name, such as defined by a token proprietor undertaking an ICO (initial coin offering). The maximum length is 50 characters.
- availablePairs array
An array of string values indicating the available currency pairs.
- baseAsset string
The base asset (or transaction currency), which is the first currency appearing in a currency pair.
- quoteAsset string
The quote asset, which is the second currency appearing in a currency pair (both direct and indirect). It is used to determine the value of a base asset.
{
"assetInfos": [
{
"id": "btc",
"name": "Bitcoin"
},
{
"id": "eth",
"name": "Ethereum"
},
{
"id": "usdt",
"name": "Usdt"
},
{
"id": "ltc",
"name": "Litecoin"
},
{
"id": "usd",
"name": "USD"
},
{
"id": "bch",
"name": "Bitcoin Cash"
}
],
"availablePairs": [
{
"baseAsset": "bch",
"quoteAsset": "btc"
},
{
"baseAsset": "bch",
"quoteAsset": "usd"
},
{
"baseAsset": "bch",
"quoteAsset": "usdt"
},
{
"baseAsset": "eth",
"quoteAsset": "usd"
},
{
"baseAsset": "ltc",
"quoteAsset": "btc"
},
{
"baseAsset": "ltc",
"quoteAsset": "usd"
},
{
"baseAsset": "ltc",
"quoteAsset": "usdt"
},
{
"baseAsset": "usdt",
"quoteAsset": "usd"
}
]
}