💫Getting Started
Prerequisites
address
active address
apply to ZKEX Team to get
api key
andapi secret
depoly
market maker signer service
and sendsigner url
to ZKEX Team
Maintain trading pairs information
Get all trading pairs infomation through the
REST
interface BnGetProductsGet any trading pair infomation through
ws
, subscribe channel ws-level2When you subscribe to ws-level2 for the first time, you will receive the snapshot data by push-snapshot
REST Interface (Recommend)
Get the server time of ZKEX
Http Method :
GET
Http Path :
/mm/api/server
Response :
Get all trading pairs supported by ZKEX
Http Method :
GET
Http Path :
/mm/api/products
Get Market Maker's JWT-Token (use to subscribe Websocket)
HTTP Method:
GET
HTTP Path:
/mm/api/users
(HMAC SHA256)HTTP Header:
X-MBX-APIKEY
:api key
Parameters:
Name | Type | Required | Example | Description |
---|---|---|---|---|
timestamp | long | YES | 1653983486 | unix timestamp |
Get Market Maker's user info
HTTP Method:
GET
HTTP Path:
/mm/api/self
(HMAC SHA256)HTTP Header:
X-MBX-APIKEY
:api key
Parameters:
Name | Type | Required | Example | Description |
---|---|---|---|---|
timestamp | long | YES | 1653983486 | unix timestamp |
Apply Order Slots Batchly
HTTP Method:
GET
HTTP Path:
/mm/api/slot
(HMAC SHA256)HTTP Header:
X-MBX-APIKEY
:api key
Parameters:
Name | Type | Required | Example | Description |
---|---|---|---|---|
timestamp | long | YES | 1653983486 | unix timestamp |
count | int | YES | 1 |
New Order
Send in a new order.
HTTP Method:
POST
HTTP Path:
/mm/api/orders
(HMAC SHA256)HTTP Header:
X-MBX-APIKEY
:api key
API Limit: A single account is only allowed to send maximum of 30 new order per second
Parameters:
Name | Type | Required | Example | Description |
---|---|---|---|---|
clientOid | string | NO | 1234 | The order id from client |
symbol | string | YES | UNI-USDC | The trading pair name |
side | string | YES | SELL | SELL/BUY |
type | string | YES | LIMIT | only support LIMIT now |
timestamp | long | YES | 1654060757 | unix timestamp |
timeInForce | string | YES | GTC | GTC/IOC/GTX/FOK |
quantity | string | YES | 20000000000000000000 | decimals=18 |
price | string | YES | 5000000000000000000 | decimals=18 |
takerFeeRatio | int | YES | 10 | decimals=4 |
makerFeeRatio | int | YES | 5 | decimals=4 |
slot | int | YES | 10 | |
nonce | int | YES | 310 | |
userPubkey | string | YES | 0dd4f603531bd78bbecd005d9e7cc62a794dcfadceffe03e269fbb6b72e9c724 | zk-layer2 pubkey |
orderSignature | string | YES | 17039d98f87640c452ec4ab6bb91d2044a97ff516a920cd09bddacd774175a28d3836dc0d84c31cc862a1c1099f430adb3f7826bf97a086eba59b6ced3e4ef04 | zk-layer2 signature for order |
Cancel Order
Cancel an active order
HTTP Method:
DELETE
HTTP Path:
/mm/api/order
(HMAC SHA256)HTTP Header:
X-MBX-APIKEY
:api key
Parameters
Name | Type | Required | Example | Description |
---|---|---|---|---|
timestamp | long | YES | 1654060757 | unix timestamp |
symbol | string | YES | UNI-USDC | The trading pair name |
orderId | int | YES | 755 |
Cancel all Open Orders on a Symbol
HTTP Meth:
DELETE
HTTP PATH:
/mm/api/orders
(HMAC SHA256)HTTP HEADER:
X-MBX-APIKEY
:api key
Parameters:
Name | Type | Required | Example | Description |
---|---|---|---|---|
timestamp | long | YES | 1654060757 | unix timestamp |
symbol | string | YES | UNI-USDC | The trading pair name |
Get all orders
Get all orders, includes new
, open
, filled
, cancelled
, cancelling
, partial
HTTP Method:
GET
HTTP PATH:
/mm/api/orders
(HMAC SHA256)HTTP HEADER:
X-MBX-APIKEY
:api key
Parameters:
Name | Type | Required | Example | Description |
---|---|---|---|---|
timestamp | long | YES | 1654060757 | unix timestamp |
symbol | string | YES | UNI-USDC | The trading pair name |
status | string | NO | filled filled,partial | The order status (support combined status) |
startTime | long | YES | 1 | |
endTime | long | YES | 1654063467 | |
limit | int | YES | 20 |
Query Order
Check an order's status.
HTTP Method:
GET
HTTP PATH:
/mm/api/order
(HMAC SHA256)HTTP Header:
X-MBX-APIKEY
:api key
Parameters:
Name | Type | Required | Example | Description |
---|---|---|---|---|
timestamp | long | YES | 1654060757 | unix timestamp |
symbol | string | YES | UNI-USDC | The trading pair name |
orderId | int | YES | 755 |
Get all open orders
HTTP Method:
GET
HTTP Path:
/mm/api/openOrders
(HMAC SHA256)HTTP Header:
X-MBX-APIKEY
:api key
Parameters:
Name | Type | Required | Example | Description |
---|---|---|---|---|
timestamp | long | YES | 1654060757 | unix timestamp |
symbol | string | YES | UNI-USDC | The trading pair name |
limit | int | YES | 20 |
Account Info
HTTP Method:
GET
HTTP Path:
/mm/api/accounts
HTTP HEADER:
X-MBX-APIKEY
:api key
Parameters:
Name | Type | Required | Example | Description |
---|---|---|---|---|
timestamp | long | YES | 1654060757 | unix timestamp |
Last updated