If you want to trade on our exchange accountless using market orders, please see our AltQuick.com/swap API: https://altquick.com/swap/api.html
Table of Contents generated with DocToc
- Public Rest API for exchange (2019-11-22)
- Endpoint security type
- SIGNED (TRADE and USER_DATA) Endpoint security
- Public API Endpoints
- Terminology
- General endpoints
- Market Data endpoints
- Account endpoints
- New order (TRADE)
- Query order (USER_DATA)
- Cancel order (TRADE)
- Current open orders (USER_DATA)
- All orders (USER_DATA)
- Account information (USER_DATA)
- Withdraw (USER_DATA)
- Account trade list (USER_DATA)
- Deposit history (USER_DATA)
- Withdraw history (USER_DATA)
- Deposit address (USER_DATA)
- New deposit address (USER_DATA)
- Api v2
- Filters
- The base endpoint is: https://altquick.com/
- All endpoints return either a JSON object or array.
- Data is returned in descending order. Newest first, oldest last.
- All time and timestamp related fields are in milliseconds.
- HTTP
4XX
return codes are used for malformed requests; the issue is on the sender's side. - HTTP
429
return code is used when breaking a request rate limit. - HTTP
5XX
return codes are used for internal errors; the issue is on exchange's side.
- Any endpoint can return an ERROR
Sample Payload below:
{
"code": -1104,
"msg": "Invalid market."
}
- Specific error codes and messages are defined in Errors Codes.
- For
GET
andPOST
andDELETE
endpoints, parameters must be sent as aquery string
. - Parameters may be sent in any order.
- Each endpoint has a security type that determines the how you will
interact with it. This is stated next to the NAME of the endpoint.
- If no security type is stated, assume the security type is NONE.
- API-keys are passed into the Rest API via the
X-MBX-APIKEY
header. - API-keys and secret-keys are case sensitive.
- By default, API-keys can access all secure routes.
Security Type | Description |
---|---|
NONE | Endpoint can be accessed freely. |
TRADE | Endpoint requires sending a valid API-Key and signature. |
USER_DATA | Endpoint requires sending a valid API-Key and signature. |
TRADE
andUSER_DATA
endpoints areSIGNED
endpoints.
SIGNED
endpoints require an additional parameter,signature
, to be sent in thequery string
.- Endpoints use
HMAC SHA256
signatures. TheHMAC SHA256 signature
is a keyedHMAC SHA256
operation. Use yoursecretKey
as the key andtotalParams
as the value for the HMAC operation. - The
signature
is not case sensitive.
- A
SIGNED
endpoint also requires a parameter,timestamp
, to be sent which should be the millisecond timestamp of when the request was created and sent. - An additional parameter,
recvWindow
, may be sent to specify the number of milliseconds aftertimestamp
the request is valid for. IfrecvWindow
is not sent, it defaults to 5000. - The logic is as follows:
if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow) { // process request } else { // reject request }
It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!
Here is a step-by-step example of how to send a vaild signed payload from the
Linux command line using echo
, openssl
, and curl
.
Key | Value |
---|---|
apiKey | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A |
secretKey | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j |
Parameter | Value |
---|---|
market | BTC_CLAM |
side | buy |
type | limit |
quantity | 1 |
price | 0.1 |
recvWindow | 5000 |
timestamp | 1499827319559 |
-
queryString: market=BTC_CLAM&side=buy&type=limit&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559
-
HMAC SHA256 signature:
[linux]$ echo -n "market=BTC_CLAM&side=buy&type=limit&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" (stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71
-
curl command:
(HMAC SHA256) [linux]$ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://altquick.com/api/v1/order?market=BTC_CLAM&side=buy&type=limit&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71'
base symbol
refers to the symbol that is thequantity
of a market.quote symbol
refers to the symbol that is theprice
of a market.
Order status (status):
- new
- partial
- filled
- canceled
- rejected
- booked
Order types (orderTypes, type):
- limit
- market
Order side (side):
- buy
- sell
Kline/Candlestick chart intervals:
m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
- 1m
- 3m
- 5m
- 15m
- 30m
- 1h
- 2h
- 4h
- 6h
- 8h
- 12h
- 1d
- 3d
- 7d
- 1M
Rate limit intervals (interval)
- SECOND
- MINUTE
- DAY
GET /api/v1/ping
Test connectivity to the Rest API.
Parameters: NONE
Response:
{}
GET /api/v1/time
Test connectivity to the Rest API and get the current server time.
Parameters: NONE
Response:
{
"timezone": "UTC"
"serverTime": 1573509210273
}
GET /api/v1/exchangeInfo
Current exchange trading rules and market information
Parameters: NONE
Response:
{
"timezone": "UTC"m
"serverTime": 1573509098104,
"exchangeFilters": [
{
"filterType": "MAX_NUM_ORDERS",
"maxNumOrders": 100
},
{
"filterType": "EXCHANGE_MAX_NUM_ORDERS",
"maxNumOrdersExchange": 1000
}
],
"markets": [
{
"id": 1,
"quote": "BTC",
"base": "CLAM",
"basePrecision": 2,
"quotePrecision": 6,
"orderTypes": [
"limit"
],
"filters": [
{
"filterType": "PRICE_FILTER",
"minPrice": "0.00000100",
"maxPrice": "10000.00000000",
"tickSize": "0.00000100"
},
{
"filterType": "LOT_SIZE",
"minQty": "0.01000000",
"maxQty": "100000.00000000",
"stepSize": "0.01000000"
}
]
}
]
}
GET /api/v1/depth
Limit | Weight |
---|---|
5, 10, 20, 50, 100 | 1 |
500 | 5 |
1000 | 10 |
5000 | 50 |
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | YES | |
limit | INT | NO | Default 100; max 5000. Valid limits:[5, 10, 20, 50, 100, 500, 1000, 5000] |
Response:
{
"bids": [
{
"price": "0.0012",
"quantity": "10.0000"
},
"asks": [
{
"price": "0.0013",
"quantity": "10.0000"
}
],
"sequence": 15
}
GET /api/v1/trades
Get recent trades (up to last 500).
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | YES | |
limit | INT | NO | Default 500; max 1000. |
Response:
[
{
"id": 3,
"market": "BTC_ETH",
"side": "sell",
"quantity": "10.00000000",
"price": "0.00400000",
"timestamp": 1573500901940
}
]
GET /api/v1/klines
Kline/candlestick bars for a market. Klines are uniquely identified by their open time.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | YES | |
interval | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1000. |
- If startTime and endTime are not sent, the most recent klines are returned.
Response:
[
[
1573246800000, // Open time
"0.0013", // Open
"0.0013", // High
"0.0013", // Low
"0.0013", // Close
"20.0000", // Volume
1573257600000, // Close time
2, // Number of trades
]
]
GET /api/v1/ticker/24hr
24 hour rolling window price change statistics.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | NO |
- If the market is not sent, tickers for all markets will be returned in an array.
Response:
{
"market": "BTC_CLAM",
"priceChange": "0.000000",
"priceChangePercent": "0",
"weightedAvgPrice": "0.000000",
"prevClosePrice": "0.000000",
"lastPrice": "0.000110",
"lastQty": "0.00",
"bidPrice": "0.000100",
"askPrice": "0.000120",
"openPrice": "0.000110",
"highPrice": "0.000000",
"lowPrice": "0.000000",
"volume": "0.00",
"quoteVolume": "0.00000000",
"count": 0,
"openTime": "2019-11-06T00:00:00Z",
"closeTime": "2019-11-07T00:00:00Z"
}
OR
[
{
"market": "BTC_CLAM",
"priceChange": "0.000000",
"priceChangePercent": "0",
"weightedAvgPrice": "0.000000",
"prevClosePrice": "0.000000",
"lastPrice": "0.000110",
"lastQty": "0.00",
"bidPrice": "0.000100",
"askPrice": "0.000120",
"openPrice": "0.000110",
"highPrice": "0.000000",
"lowPrice": "0.000000",
"volume": "0.00",
"quoteVolume": "0.00000000",
"count": 0,
"openTime": "2019-11-06T00:00:00Z",
"closeTime": "2019-11-07T00:00:00Z"
}
]
GET /api/v1/ticker/price
Latest price for a market or markets.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | NO |
- If the market is not sent, prices for all markets will be returned in an array.
Response:
{
"market": "BTC_CLAM",
"price": "0.000110"
}
OR
[
{
"market": "BTC_CLAM",
"price": "0.000110"
},
{
"market": "BTC_ETH",
"price": "0.0040"
}
]
GET /api/v1/ticker/bookTicker
Best price/qty on the order book for a market or markets.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | NO |
- If the market is not sent, bookTickers for all markets will be returned in an array.
Response:
{
"market": "BTC_CLAM",
"bidPrice": "4.00000000",
"bidQty": "431.00000000",
"askPrice": "4.00000200",
"askQty": "9.00000000"
}
OR
[
{
"market": "BTC_CLAM",
"bidPrice": "4.00000000",
"bidQty": "431.00000000",
"askPrice": "4.00000200",
"askQty": "9.00000000"
},
{
"market": "BTC_LTC",
"bidPrice": "0.07946700",
"bidQty": "9.00000000",
"askPrice": "100000.00000000",
"askQty": "1000.00000000"
}
]
POST /api/v1/order (HMAC SHA256)
Send in a new order.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | YES | |
side | ENUM | YES | |
type | ENUM | YES | |
quantity | DECIMAL | YES | |
price | DECIMAL | NO | |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Additional mandatory parameters based on type
:
Type | Additional mandatory parameters |
---|---|
LIMIT |
quantity , price |
MARKET |
quantity ( qty in base symbol for sell, quote symbol for buy) |
Response:
{
"order_id": "72253ef2-abf1-4078-8375-c6ee690ec406',
"user_id": "ca41eaeb-21af-4918-9131-91d19ba2a87a',
"price": "0.00000100",
"quantity": "2.00000000",
"market": "BTC_CLAM",
"side": "sell",
"order_type": "market",
"order_state": "filled",
"trades":
[ { "order_id": "72253ef2-abf1-4078-8375-c6ee690ec406",
"user_id": "c1932526-8885-45af-a91a-c35aa4a2caf7",
"trade_id": 9086,
"market": "BTC_CLAM",
"side": "sell",
"price": "0.00011000",
"quantity": "0.91000000",
"maker": false,
"total": "0.00010010",
"commission": "0.00000051",
"commission_asset": "BTC",
"date": "2019-11-21T18:25:38.780258882Z" },
{ "order_id": "72253ef2-abf1-4078-8375-c6ee690ec406",
"user_id": "c1932526-8885-45af-a91a-c35aa4a2caf7",
"trade_id": 9087,
"market": "BTC_CLAM",
"side": "sell",
"price": "0.00011000",
"quantity": "1.09000000",
"maker": false,
"total": "0.00011990",
"commission": "0.00000060",
"commission_asset": "BTC",
"date": "2019-11-21T18:25:38.819797122Z" }
]
}
GET /api/v1/order (HMAC SHA256)
Check an order's status.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | YES | |
orderID | LONG | NO | |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Notes:
- Either
orderID
ororigClientOrderID
must be sent.
Response:
{
"order_id": "72253ef2-abf1-4078-8375-c6ee690ec406',
"user_id": "ca41eaeb-21af-4918-9131-91d19ba2a87a',
"price": "0.00000100",
"quantity": "2.00000000",
"market": "BTC_CLAM",
"side": "sell",
"order_type": "market",
"order_state": "filled",
}
DELETE /api/v1/order (HMAC SHA256)
Cancel an active order.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | YES | |
orderID | LONG | NO | |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Either orderID
or origClientOrderID
must be sent.
Response:
{
"order_id": "72253ef2-abf1-4078-8375-c6ee690ec406',
"user_id": "ca41eaeb-21af-4918-9131-91d19ba2a87a',
"price": "0.00110000",
"quantity": "2.00000000",
"market": "BTC_CLAM",
"remaining": "2.00000000",
"side": "sell",
"order_type": "limit",
"order_state": "cancelled",
}
GET /api/v1/openOrders (HMAC SHA256)
Get all open orders on a market.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | YES | |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Response:
[
{
"order_id": "72253ef2-abf1-4078-8375-c6ee690ec406",
"user_id": "ca41eaeb-21af-4918-9131-91d19ba2a87a",
"price": "0.00110000",
"quantity": "10.00000000",
"market": "BTC_ETH",
"side": "buy",
"remaining": "10.00000000",
"order_type": "limit",
"order_state": "booked",
"created_at": "2019-11-08T19:44:06.981056Z"
}
]
GET /api/v1/allOrders (HMAC SHA256)
Get all account orders; active, canceled, or filled.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | YES | |
orderID | LONG | NO | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1000. |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Notes:
- If
orderID
is set, it will get orders >= thatorderID
. Otherwise most recent orders are returned.
Response:
[
{
"order_id": "72253ef2-abf1-4078-8375-c6ee690ec406",
"user_id": "ca41eaeb-21af-4918-9131-91d19ba2a87a",
"price": "0.00110000",
"quantity": "10.00000000",
"market": "BTC_ETH",
"side": "buy",
"remaining": "10.00000000",
"order_type": "limit",
"order_state": "booked",
"created_at": "2019-11-08T19:44:06.981056Z"
}
]
GET /api/v1/account (HMAC SHA256)
Get current account information.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Response:
{ balances:
canTrade: false,
canWithdraw: false,
[
{
"asset": "BTC",
"free": "999.80160609",
"pending": "0.00000000",
"locked": "0.04140000"
},
{
"asset": "CLAM",
"free": "998.88888890",
"pending": "0.00000000",
"locked": "0.00000000"
}
]
}
POST /api/v1/withdraw (HMAC SHA256)
Request a withdraw for a specific market.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | STRING | YES | |
destination | string | NO | |
quantity | DECIMAL | NO | |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Response:
[
{
"id": 28457,
"user_id": "ca41eaeb-21af-4918-9131-91d19ba2a87a",
"symbol": "CLAM",
"destination": "xX3gahy5kjozWwaPKViDDiF4vkGfUhMiyU",
"amount": "10.0000",
"txid": "e3748cbc9bd38edbd1a63d6c2f3f6044e9294bbdebaab2a2d416e1a78abf1030",
"state": "complete",
"complete": true,
"fee": "0.00100000",
}
]
GET /api/v1/myTrades (HMAC SHA256)
Get trades for a specific account and market.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
market | STRING | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
fromId | LONG | NO | TradeId to fetch from. Default gets most recent trades. |
limit | INT | NO | Default 500; max 1000. |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Notes:
- If
fromId
is set, it will get orders >= thatfromId
. Otherwise most recent orders are returned.
Response:
[
{
"order_id": "9574c6c5-cd3d-41d3-88b5-abfa836ac111",
"user_id": "ca41eaeb-21af-4918-9131-91d19ba2a87a",
"trade_id": 3,
"market": "BTC_ETH",
"side": "buy",
"price": "0.00400000",
"quantity": "10.00000000",
"maker": true,
"total": "0.04000000",
"commission": "0.05000000",
"commission_asset": "ETH",
"date": "2019-11-11T19:35:01.897252Z"
}
]
GET /api/v1/depositHistory (HMAC SHA256)
Get deposits for a specific account and market.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | STRING | NO | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1000. |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Response:
[
{
"user_id": "ca41eaeb-21af-4918-9131-91d19ba2a87a",
"symbol": "CLAM",
"address": "xLpyii7piMV6Y4jx1UKr5QfxyswkALniD3",
"amount": "0.01",
"txid": "00bbfec31dc6f2c0ff917524768786258bb057c471a536eaa960999c4e334c26",
"confirmations": 30,
"confirmed": true,
"complete": false,
"state": "complete",
"created_at": 1571159819902,
"updated_at": 1571161613058
}
]
GET /api/v1/withdrawHistory (HMAC SHA256)
Get withdrawals for a specific account and symbol.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | STRING | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1000. |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Response:
[
{
"id": 52,
"user_id": "ca41eaeb-21af-4918-9131-91d19ba2a87a",
"symbol": "CLAM",
"destination": "x9Ph1xyrN7z4vfzYuNCdujgrX2Ly2SQsPs",
"amount": "10.00100000",
"txid": "6d5069d30a87bcd4c7631890e20375119444adcb52b97bb77a8183fe960e437a",
"state": "complete",
"fee": "0.00100000",
"complete": true,
"failed": false,
"cancelled": false,
"rejected": false,
"reject_reason": "",
"updated_at": 1572482164000
}
]
GET /api/v1/deposit (HMAC SHA256)
Get current account deposit address(s) for a specific symbol or all if no symbol given.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Response:
[
{
address: 'xLpyii7piMV6Y4jx1UKr5QfxyswkALniD3',
symbol: 'CLAM'
}
]
POST /api/v1/deposit (HMAC SHA256)
Get new deposit address for a specific symbol.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
Response:
[
{
"address": "xLpyii7piMV6Y4jx1UKr5QfxyswkALniD3",
"symbol": "CLAM"
}
]
GET /api/v2/markets
The markets (summary) endpoint is to provide an overview of market data for all tickers and all market pairs on the exchange.
Parameters: NONE
Response:
{
"BTC_42":
{
"trading_pairs":"BTC_42",
"base_currency":"42",
"quote_currency":"BTC",
"last_price":"1.15",
"lowest_ask":"1.90",
"highest_bid":"1.45",
"price_change_percent_24h":"0",
"base_volume":"0.000000",
"quote_volume":"0.00000000",
"highest_price_24h":"0.00",
"lowest_price_24h":"0.00"
},
"BTC_AVAX":
{
"trading_pairs":"BTC_AVAX",
"base_currency":"AVAX",
"quote_currency":"BTC",
"last_price":"0.0007",
"lowest_ask":"0.0008",
"highest_bid":"0.0007",
"price_change_percent_24h":"0",
"base_volume":"0.0000",
"quote_volume":"0.00000000",
"highest_price_24h":"0.0000",
"lowest_price_24h":"0.0000"
},
...
}
GET /api/v2/assets
The assets endpoint is to provide a detailed summary for each currency available on the exchange.
Parameters: NONE
Response:
{
"42":{
"name":"42-coin",
"unified_cryptoasset_id":93,
"can_withdraw":"true",
"can_deposit":"true",
"min_withdraw":"0.00001001",
"max_withdraw":"0.40423208",
"maker_fee":"0.002",
"taker_fee":"0.002"
},
"AVAX":{
"name":"Avalanche",
"unified_cryptoasset_id":5805,
"can_withdraw":"true",
"can_deposit":"true",
"min_withdraw":"0.01100000",
"max_withdraw":"47.04644921",
"maker_fee":"0.002",
"taker_fee":"0.002"
},
...
}
GET /api/v2/ticker
The ticker endpoint is to provide a 24-hour pricing and volume summary for each market pair available on the exchange.
Parameters: NONE
Response:
{
"BTC_42":{
"base_id":93,
"quote_id":1,
"last_price":"1.15",
"base_volume":"0.000000",
"quote_volume":"0.00000000",
"isFrozen":"false"
},
"BTC_AVAX":{
"base_id":5805,
"quote_id":1,
"last_price":"0.0007",
"base_volume":"0.0000",
"quote_volume":"0.00000000",
"isFrozen":"false"
},
...
}
GET /api/v2/orderbook/{MARKET_PAIR}
The order book endpoint is to provide a complete level 2 order book (arranged by best asks/bids) with full depth returned for a given market pair.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
level | LONG | NO | Level 1 – Only the best bid and ask. Level 2 – Arranged by best bids and asks. |
depth | LONG | NO | Not defined or 0 = full order book |
Response:
{
"timestamp": "1671507684",
"bids": [
[
"0.000003",
"24110.05"
],
[
"0.000002",
"92525.05"
],
...
],
"asks": [
[
"0.000004",
"658.37"
],
[
"0.000005",
"8781.73"
],
...
]
}
GET /api/v2/trades/{MARKET_PAIR}
The trades endpoint is to return data on all recently completed trades for a given market pair.
Parameters: NONE
Response:
[
{
"trade_id": 20690,
"price": "0.00000400",
"base_volume": "0.00007200",
"quote_volume": "0.00000018",
"timestamp": 1671502762894,
"type": "buy"
},
{
"trade_id": 20689,
"price": "0.00000400",
"base_volume": "0.00011200",
"quote_volume": "0.00000028",
"timestamp": 1671484043527,
"type": "buy"
},
...
]
Filters define trading rules on a market or an exchange.
Filters come in two forms: market filters
and exchange filters
.
The PRICE_FILTER
defines the price
rules for a market. There are 3 parts:
minPrice
defines the minimumprice
allowed; disabled onminPrice
== 0.maxPrice
defines the maximumprice
allowed; disabled onmaxPrice
== 0.tickSize
defines the intervals that aprice
can be increased/decreased by; disabled ontickSize
== 0.
Any of the above variables can be set to 0, which disables that rule in the price filter
. In order to pass the price filter
, the following must be true for price
of the enabled rules:
price
>=minPrice
price
<=maxPrice
- (
price
-minPrice
) %tickSize
== 0
/exchangeInfo format:
{
"filterType": "PRICE_FILTER",
"minPrice": "0.00000100",
"maxPrice": "100000.00000000",
"tickSize": "0.00000100"
}
The LOT_SIZE
filter defines the quantity
(aka "lots" in auction terms) rules for a market. There are 3 parts:
minQty
defines the minimumquantity
allowed.maxQty
defines the maximumquantity
allowed.stepSize
defines the intervals that aquantity
can be increased/decreased by.
In order to pass the lot size
, the following must be true for quantity
:
quantity
>=minQty
quantity
<=maxQty
- (
quantity
-minQty
) %stepSize
== 0
/exchangeInfo format:
{
"filterType": "LOT_SIZE",
"minQty": "0.00100000",
"maxQty": "100000.00000000",
"stepSize": "0.00100000"
}
The MARKET_QUANTITY_INPUT
filter defines the symbol used for quantity input when making a market
order on the given order side. Any market orders submitted quantity will be assumed to be in the symbol defined in the MARKET_QUANTITY_INPUT
filter.
/exchangeInfo format:
{
"filterType": "MARKET_QUANTITY_INPUT",
"buy": "quote",
"sell": "base",
}
The MAX_NUM_ORDERS
filter defines the maximum number of orders an account is allowed to have open on a market.
Note that both "algo" orders and normal orders are counted for this filter.
/exchangeInfo format:
{
"filterType": "MAX_NUM_ORDERS",
"limit": 25
}
The MIN_ORDER_SIZE
filter defines the minimum value allowed for an order on a market.
An order's value is the price
* quantity
.
/exchangeInfo format:
{
"filterType": "MIN_NOTIONAL",
"minNotional": "0.00001000",
}
The MAX_NUM_ORDERS
filter defines the maximum number of orders an account is allowed to have open on the exchange.
Note that both "algo" orders and normal orders are counted for this filter.
/exchangeInfo format:
{
"filterType": "EXCHANGE_MAX_NUM_ORDERS",
"maxNumOrders": 1000
}