Any comment about status
channel?
Also both ticker channels seems to be missing data compared to Coinbase Pro websocket.
Any comment about status
channel?
Also both ticker channels seems to be missing data compared to Coinbase Pro websocket.
Hi @muktupavels, the “status” channel should work as expected since all the channel scripts were changed/updated. Please let us know if you would be experiencing any errors/challenges. With regards to your concern about the “missing data” in both ticker channels, can you elaborate on what you mean by that? This will help us in better understanding your situation. Thank you!
Hi there @dpkw! As of the moment, the team is still hard at work on this and cannot give out an exact date. Do not worry though as we will give an update once this issue has been resolved. Thank you and keep in touch!
I just posted a note about the missing data in the Feedback thread. It looks like data points like Best Bid, Best Ask, Last Size which are present in the Coinbase Pro websocket are not present in the Advanced Trade websocket. Appears there may be a few other fields as well.
Hello @channa48. I appreciate your feedback and feature requests in the Advanced Trade Feedback thread. Coinbase is currently building REST and Websocket protocols on Advanced Trade so that customers can use Advanced Trade under one unified Coinbase account. However, the team is still hard at work on this and can’t offer any specific timeline for the features you’ve mentioned. For more updates regarding your queries, I suggest you regularly check the Advanced Trade Feedback thread. If you have any other feedback or requests, feel free to post them in the Feedback Section of the Developer Forum. Thank you!
In regards to the original post, I think it’s because you have the brackets. In JSON, ["string_inside_of_brackets"]
still equates to an array, even if the only item in the array is a string.
On the Coinbase side, they are parsing the JSON data you send, and putting it into a Go struct which is expecting a string. ["ticker"]
equates to an array, so it throws an error because it sees the wrong data type. Try just "channel": "ticker"
"channel":"status"
should be correct. I believe that channel also needs a list of products that you want updates for. The docs say “all products” but I get the same mostly blank message you do if I don’t send an array of products as well. When I do send products, I get a status message for each product. Apparently this is sent at intervals but I don’t know what those intervals are. I’m assuming daily or something slow like that.
I already figured out that channel is just string and they have also updated documentation.
Status channel becomes somewhat useless to me if I have to specify products. I want to receive info about all products and all currencies as documentation says. I use status channel to know when new products are added, products have some changes or are removed. Same with currencies.
Also interval is not daily, at least not in Coinbase Pro. It is 5s if I remember correctly.
Fair enough. @Faker said it was fixed now, maybe it isn’t? I never used the Pro websocket and don’t see much use for the current status channel. The /products REST endpoint returns far more data about all products than the status channel. I would just call that every 5 seconds and parse for any with the “new: true” attribute. For now at least.
It must be broken. Other channels are fine, but it’s definitely been more than 5 seconds and I have only received the initial message.
user and level2 channels appear to be working now
Hello there @muktupavels , @han, and @dpkw! Just an update, fix for channels user & level2 are deployed to production & doc - WS Channel is updated as well. Thank you @jmicko, for providing an update to the community as well, really appreciated it.
Documentation needs more fixes. side
now seems to be “bid” or “offer” while documentation still mentions “buy” as example. Also data does not have have size
property, it is now called new_quantity
.
Hello @muktupavels! Thank you for flagging this mismatch between the Websocket Channel response data and the available Advanced Trade documentation. Related to this, we’d appreciate it if you could log this concern in the Feedback Section of the Developer Forum so the relevant Team could take a look at it, as most new improvements to Coinbase come directly from feedback like yours. Have a great day!
Hi there @muktupavels! The documentation has now been updated. The sample is now "side":"bid"
, side is either bid
or ask
. The size property is now replaced by new_quantity. Stay tuned for more updates ahead. Have a great day!
Ah - turns out posting this comment [I’ve now edited out my question] gave me permission to create a new post, so I’ve done that here: Advanced Trade API Websockets - Authenticating user and subscribing to user channel
Thanks for your help!
Hi @muktupavels! We would like to inform you that the interval is not daily, updates will be sent every 250ms if there are any updates applicable. However, the fields returned in the status channel do not change often (base increment for example is not something that would change every 250ms), so the data is mostly consistent and changes infrequently.
We hope this clarifies. Happy Holidays!
Hi this thread was in Nov/Dec timeframe and some of the documentation etc has been updated. However, I’m getting some of the same types of errors reported above, for my python code I have:
33 now = int(time.time())
34 str_to_sign_websocket = str(now) + 'level2' + ',BTC-USD'
35 signature_websocket = hmac.new(str_to_sign_websocket.encode('utf-8'), coinbase_config['API_SECRET'].encode('utf-8'), hashlib.sha256).hexdigest()
36 print(signature_websocket)
37 subscribe_message = {
38 "type": "subscribe",
39 'product_ids' : ['BTC-USD'] ,
40 "channel": "level2",
41 "signature" : signature_websocket,
42 "timestamp": str(now),
43 "api_key": coinbase_config['API_KEY'],
44 }
45 print(json.dumps(subscribe_message))
46 ws.send(json.dumps(subscribe_message))
this results in the following error:
{"type":"error","message":"channel `level2` is not supported"}
the redacted message looks like
{"type": "subscribe", "product_ids": ["BTC-USD"], "channel": "level2", "signature": "535130085e825858d9be9445b305f5e2c067e82a53876f75359ae266f2bf3022", "timestamp": "1678998959", "api_key": "xxxxxxxxxxxxxxxxxxxx"}
Can someone help here. I’m able to subscribe to the Rest API with the same keys no problem.
Don’t know if that is problem but try removing comma before BTC-USD
in str_to_sign_websocket
.
Thanks for the suggestion, same result however. I also tried the way the documentation describes it (Overview | Coinbase Cloud):
{
"type": "subscribe",
"product_ids": [
"ETH-USD",
"ETH-EUR"
],
"channels": [
"level2",
"heartbeat",
{
"name": "ticker",
"product_ids": [
"ETH-BTC",
"ETH-USD"
]
}
]
}
but this results in this error
{"type":"error","message":"channel is required"}```
The docs you linked to here are for the old Coinbase Pro feed. You want the Coinbase Advanced docs. You had it right in the first post with the signature etc. You’re getting the “channel is required” error because the old ws feed required “channels” while the new one requires “channel”.
This makes me wonder if you’re referencing the old docs to get the endpoint as well. Make sure you’re hitting the new endpoint with the new sub format and see if that helps. Should be wss://advanced-trade-ws.coinbase.com
.