ZKEX Docs
  • Overview
    • ❓What is ZKEX?
    • 🌐How ZKEX works
    • ✨Supported chains and coins
    • 🎟️ZKEX Account
    • 📈Trading
    • 💰Fees
    • 🔐Security
    • 🪙Tokenomics
    • 📔Resources
    • 🛣️Roadmap
  • NETWORK INFORMATION
    • 💸Supported Tokens
    • 🛫Mainnet Contract Address
    • 🛬Testnet Contract Address
  • ZKEX2.0 MARKET MAKER APIS
    • 💫Getting Started
    • 🤍Websocket Subscribe & Unsubscribe
    • 📌Websocket Data Push
Powered by GitBook
On this page
  • Order data of any trading pair (level2)
  • K-line data of a trading pair (1/3/5/15/30/60min/2/4/6/12/24hour)
  • Ticker info of a trading pair
  • Matching information of a trading pair
  • Success order information of a trading pair
  • Order change infomation of a trading pair
  • The asset change information of an account
  1. ZKEX2.0 MARKET MAKER APIS

Websocket Subscribe & Unsubscribe

PreviousGetting StartedNextWebsocket Data Push

Last updated 1 year ago

Order data of any trading pair (level2)

{
  "type": "subscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "level2"
  ],
  "token": "" #option
}
{
  "type": "unsubscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "level2"
  ],
  "token": "" #option
}

Notice:

When you subscribe to for the first time, you will receive the snapshot data by


K-line data of a trading pair (1/3/5/15/30/60min/2/4/6/12/24hour)

{
  "type": "subscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "candles_1m"
  ],
  "token": ""   # optional (JWT-token)
}
{
  "type": "unsubscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "candles_1m"
  ],
  "token": ""    # optional (JWT-token)
}
channel name
time

candles_1m

1min

candles_3m

3min

candles_5m

5min

candles_15m

15min

candles_30m

30min

candles_60m

60min

candles_120m

2hour

candles_240m

4hour

candles_360m

6hour

candles_720m

12hour

candles_1440m

24hour


Ticker info of a trading pair

{
  "type": "subscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "ticker"
  ],
  "token": ""    # optional (JWT-token)
}
{
  "type": "unsubscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "ticker"
  ],
  "token": ""    # optional (JWT-token)
}

Matching information of a trading pair

{
  "type": "subscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "match"
  ],
  "token": ""    # optional (JWT-token)
}
{
  "type": "unsubscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "match"
  ],
  "token": ""    # optional (JWT-token)
}

Success order information of a trading pair

{
  "type": "subscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "trade"
  ],
  "token": ""    # required (JWT-token) 
}
{
  "type": "unsubscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "trade"
  ],
  "token": ""    # required (JWT-token)
}

Order change infomation of a trading pair

{
  "type": "subscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "order"
  ],
  "token":""  # required (JWT-token)
}
{
  "type": "unsubscribe",                                
  "product_ids": [
    "UNI-USDC"
  ],
  "channels": [
    "order"
  ],
  "token": ""  # required (JWT-token)
}

The asset change information of an account

{
  "type": "subscribe",                                
  "currency_ids": [
    "UNI",
    "USDC"
  ],
  "channels": [
    "funds"
  ],
  "token": ""   # required (JWT-token)
}
{
  "type": "unsubscribe",                                
  "currency_ids": [
    "UNI",
    "USDC"
  ],
  "channels": [
    "funds"
  ],
  "token":""   # required (JWT-token)
}
🤍
level2
push-snapshot