0xProject / standard-relayer-api

Standard specifications for 0x relayer public APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snapshot in V2 websocket orderbook subscribe?

BlinkyStitt opened this issue · comments

v0 had a very handy option to return a limited amount of the orderbook on subscribe before streaming order updates ("snapshot" and "limit" at https://github.com/0xProject/standard-relayer-api/blob/master/ws/v0.md#orderbook-channel).

I was updating some code to use v2, and I can't find this option. Was it removed? If so, why? What is the recommend work-around?

I'm thinking I'll have to use the http api to get the orderbook and then the websocket api to subscribe. My code for v1 currently just uses websockets and adding an http library is a bit more complexity than I was hoping for.

Hi @wysenynja. Yes you're right it was removed and we recommend you use the /orderbook endpoint from the HTTP API. However, we appreciate your feedback and if we keep on hearing this type of feedback we may re-add the websocket option back in the future!

Thanks. I've updated my code to use the HTTP API to query each orderbook snapshot, but this requires a lot of requests. At the moment there are around 350 markets on RadarRelay to check and each now requires a separate API request. Before this was 1 request. Now I'm having to add rate-limiting code to make sure I don't go over my request limits which are 120/minute.