The depth of a transaction pair.
URL:
wss://api.crossexchange.io/wsv1
Request:
{"event":"subscribe", "channel":"depth","pair":"ETH_USDT","depth":20, "prec":0}
event |
Subscribe |
channel |
depth |
pair |
pair name |
depth |
Rows of order books, the same rows of bid and ask.eg.20, return 20 rows bids and 20 rows asks. |
prec |
The decimals places for deep merging, differently decimals for each pair. |
Response:
{
"channel":"depth",
"pair":"ETH_USDT",
"prec-len":"8",
"prec-list":"8,7,6,5",
"data":
{
"bids":[
["2473.88","2.025",“15151”],
["2473.5","2.4",“15151”],
["2470","12.203",“15151”]
],
"asks":[
["2484","17.234",“15151”],
["2483.01","6",“15151”],
["2482.88","3",“15151”]
],
"timestamp":1411718972024}
}
prec-len |
The default number of decimal places for the price |
prec-list |
The list of decimal places, |
data |
return the full list for the first time, update sends return the changed list. |
timestamp |
timestamp |
Upload:
{
"channel":"depth",
"pair":" ETH_USDT ",
"data":{"change":
[
["2473.88", "2.025", "15151"],
["2473.5", "2.4", "15151"],
["2470", "12.203", "15151"]
],
"timestamp":1411718972024}
}
Notes:
A positive price means bids and a negative number indicates asks.
The depth messages are sent when the order-book changes, up to one update per second.