# Spot Market Trends

# Spot K-Line

Title: PUBLIC@SPOT_KLINE?<SYMBOL>&<PERIOD>

Module Type Resource Isolation Type
Spot market (SPOT_MARKET) Query (QUERY) Trading Pair (SYMBOL)

# Subscription Parameters

Parameter Name Description Example Value
SYMBOL Trading Pair Name BTC/USDT, etc. Please use the RestAPI spot trading pair configuration interface to retrieve all supported trading pairs
PERIOD Candlestick Interval MIN1: 1-minute candlestick; MIN5: 5-minute candlestick; MIN15: 15-minute candlestick; MIN30: 30-minute candlestick; MIN60: 1-hour candlestick; HOUR4: 4-hour candlestick; DAY1: daily candlestick; MON1: monthly candlestick;

# 消息参数

Name Type Description
id Long id,same as time
t Long Candlestick ID
a Decimal Trading volume in base currency
ct Long Number of trades
o Decimal Opening price in this period
c Decimal Closing price in this period
l Decimal Lowest price in this period
h Decimal Highest price in this period
v Decimal Trading volume in quote currency
s String Trading pair
p KlinePeriodEnum Candlestick interval

# Subscription Example

{"method":"SUBSCRIBE","subject":"PUBLIC@SPOT_KLINE?BTC/USDT&MIN1"}

# Message Notification Example

{
	"d": {
		"p": "MIN1",
		"a": 3.24245000,
		"ct": 71,
		"c": 30683.73,
		"s": "BTC/USDT",
		"t": 1688552880,
		"v": 99526.1827759000000000,
		"h": 30702.15,
		"id": 1688552880,
		"l": 30680.71,
		"o": 30700.00000000
	},
	"e": "MESSAGE",
	"s": "PUBLIC@SPOT_KLINE?BTC/USDT&MIN1"
}

# Spot Trade Records

Title: PUBLIC@SPOT_TRADE?<SYMBOL>

Module Type Resource Isolation Type
SPOT_MARKET Query (QUERY) Trading pair (SYMBOL)

# Subscription Parameters

Parameter Name Description Example Value
SYMBOL Trading Pair Name BTC/USDT, etc. Please use the RestAPI spot trading pair configuration interface to retrieve all supported trading pairs

# Message Parameters

Name Type Description
s String Trading pair
t Long Timestamp
a Decimal Trade Quantity
p Decimal Trade Price
d String buy (buying), sell (selling)

# 订阅示例

{"method":"SUBSCRIBE","subject":"PUBLIC@SPOT_TRADE?BTC/USDT"}

# Subscription Example

{
	"d": {
		"p": 30702.03,
		"a": 0.00359,
		"s": "BTC/USDT",
		"t": 1688552725746,
		"d": "buy"
	},
	"e": "MESSAGE",
	"s": "PUBLIC@SPOT_TRADE?BTC/USDT"
}

# Message Notification Example

Title: PUBLIC@SPOT_TICKER?<SYMBOL>

Module Type Resource Isolation Type
SPOT_MARKET Query(QUERY) Trading pair(SYMBOL)

# Subscription Parameters

Parameter Name Description Example Value
SYMBOL Trading Pair Name BTC/USDT, etc. Please use the RestAPI spot trading pair configuration interface to retrieve all supported trading pairs

# Message Parameters

Name Type Description
s String Trading pair
id Long id,same as time
o Decimal Opening price in this period
c Decimal Closing price in this period
l Decimal Lowest price in this period
h Decimal Highest price in this period
ct Long Trade quantity
v Decimal Trade volume
a Decimal Trade amount
ver Long Version number
bid Buy One
ask Sell One

# Subscription Example

{"method":"SUBSCRIBE","subject":"PUBLIC@SPOT_TICKER?BTC/USDT"}

# Message Notification Example

{
	"d": {
		"ct": 35613,
		"a": 53365.53611,
		"s": "BTC/USDT",
		"c": 30799.82,
		"v": 1643984625.34629780,
		"h": 30832.80,
		"id": 1324562692265500674,
		"l": 30771.19,
		"o": 30807.73
	},
	"e": "MESSAGE",
	"s": "PUBLIC@SPOT_TICKER?BTC/USDT"
}

# Depth Update Notification

Title: PUBLIC@SPOT_DEPTH?<SYMBOL>&<DEPTH>

Module Type Resource Isolation Type
SPOT_MARKET Query(QUERY) Trading pair(SYMBOL)

# Subscription Parameters

Parameter Name Description Example Value
SYMBOL Trading Pair Name BTC/USDT, etc. Please use the RestAPI spot trading pair configuration interface to retrieve all supported trading pairs
DEPTH Depth Level DEPTH_5: 5 levels of depth; DEPTH_10: 10 levels of depth; DEPTH_20: 20 levels of depth; DEPTH_50: 50 levels of depth

# Message Parameters

Name Type Description
s String Currency Pair
t Long Generation Time
bids Array Buy Orders
| a Decimal Quantity
| p Decimal Price
asks Array Sell Orders
| a Decimal Quantity
| p Decimal Price

# Subscription Example

{"method":"SUBSCRIBE","subject":"PUBLIC@SPOT_DEPTH?BTC/USDT&DEPTH_5"}

# Message Notification Example

{
    "d":{
        "s":"BTC/USDT",
        "t":1688725772858,
        "asks":[
            {
                "p":30233.86364,
                "a":0.5938
            },
            {
                "p":30233.97408,
                "a":0.59529
            },
            {
                "p":30234.22508,
                "a":0.88836
            },
            {
                "p":30238.974,
                "a":0.62001
            },
            {
                "p":30238.97408,
                "a":0.1206
            }
        ],
        "bids":[
            {
                "p":29992.9464,
                "a":0.53715
            },
            {
                "p":29988.35484,
                "a":0.44678
            },
            {
                "p":29987.79708,
                "a":0.13787
            },
            {
                "p":29987.39868,
                "a":0.58617
            },
            {
                "p":29985.41664,
                "a":0.24439
            }
        ],
        "ds":"STEP0"
    },
    "e":"MESSAGE",
    "s":"PUBLIC@SPOT_DEPTH?BTC/USDT&DEPTH_5"
}

# Bid and Ask Update Notification

Title: PUBLIC@SPOT_DEPTH_FIRST?<SYMBOL>

Module Type Resource Isolation Type
SPOT_MARKET Query(QUERY) Trading pair(SYMBOL)

# Subscription Parameters

Parameter Name Description Example Value
SYMBOL Trading Pair Name BTC/USDT, etc. Please use the RestAPI spot trading pair configuration interface to retrieve all supported trading pairs

# Message Parameters

Name Type Description
s String Currency Pair
t Long Generation Time
bids Arryy Buy Orders
| a Decimal Quantity
| p Decimal Price
asks Array Sell Orders
| a Decimal Quantity
| p Decimal Price

# Subscription Example

{"method":"SUBSCRIBE","subject":"PUBLIC@SPOT_DEPTH_FIRST?BTC/USDT"}

# Message Notification Example

{
	"d": {
		"s": "BTC/USDT",
		"t": 1688552982437,
		"asks": [{
			"a": 0.73252,
			"p": 30800.02
		}, {
			"a": 0.0007,
			"p": 30670.45
		}],
		"bids": []
	},
	"e": "MESSAGE",
	"s": "PUBLIC@SPOT_DEPTH_FIRST?BTC/USDT"
}

# Spot Market Summary Update Notification

Title : PUBLIC@SPOT_MARKET_DETAIL?<SYMBOL>

Module Type Resource Isolation Type
SPOT_MARKET Query(QUERY) Trading pair(SYMBOL)

# Subscription Parameters

Parameter Name Description Example Value
SYMBOL Trading Pair Name BTC/USDT, etc. Please use the RestAPI spot trading pair configuration interface to retrieve all supported trading pairs

# Message Parameters

Name Type Description
s String Currency Pair
id Long ID
o Decimal Opening Price
c Decimal Closing Price
l Decimal Lowest Price
h Decimal Highest Price
ct Long Trade Quantity
v Decimal Trade Volume
a Decimal Trade Amount
ver Long Version Number
bid Array Buy Orders
a Decimal Quantity
p Decimal Price
ask Array Sell Orders
a Decimal Quantity
p Decimal Price

# Subscription Example

{"method":"SUBSCRIBE","subject":"PUBLIC@SPOT_MARKET_DETAIL?BTC/USDT"}

# Message Notification Example

{
	"d": {
		"ct": 35601,
		"a": 53348.28774,
		"s": "BTC/USDT",
		"c": 30793.24,
		"v": 1643452854.57078570,
		"h": 30832.80,
		"ask": {
			"a": 1.23607,
			"p": 30832.81
		},
		"id": 1324562692265500674,
		"l": 30771.19,
		"bid": {
			"a": 1.26874,
			"p": 30771.18
		},
		"o": 30809.88
	},
	"e": "MESSAGE",
	"s": "PUBLIC@SPOT_MARKET_DETAIL?BTC/USDT"
}