decred / dcrdex

The Decred Decentralized Exchange (DEX), powered by atomic-swaps.
Other
182 stars 90 forks source link

Suggestion: Fiat rate source with support for websockets #2565

Open ukane-philemon opened 11 months ago

ukane-philemon commented 11 months ago

@buck54321: // coinpaprika has two options. /tickers is for the top 2500 assets all in // one request. /ticker/[slug] is for a single ticker. From testing // Single ticker request took 274.626125ms // Size of single ticker response: 0.733 kB // All tickers request took 47.651851ms // Size of all tickers response: 1828.863 kB // Single ticker requests were < 1 kB, while all tickers were 1.8 MB, but // the larger request was faster (without json decoding). Coinpaprika's, // free tier allows up to 25k requests per month. For a // fiatRateRequestInterval of 12 minutes, that 3600 requests per // month for the all tickers request, and 3600 * N requests for N assets. // So any more than 25000 / 3600 = 6.9 assets, and we can expect to run into // rate limits. But the bandwidth of the full tickers request is kinda // ridiculous too. Solution needed.

I'm leaning towards fiat rate sources with WebSocket support as they'll make this easier and save us the headache of dealing with rate limits. We can always use the REST APIs as a fallback.

Thinking of Binance, Bittrex, Kucoin etc... Coinpaprika says they are actively working on alternate methods and that "WebSockets streaming interface is under active development". I can't tell if Messari has websocket support cuz I found nothing while researching.

Most exchanges now encourage receiving data via WebSockets.

What do y'all think?

Edit: It seems Coinpaprika supports WS (https://streaming.coinpaprika.com/) but is limited to >$799 plan.

buck54321 commented 10 months ago

Of course WebSocket feeds are always preferred. I may be misunderstanding, but have you identified a reliable WebSockets fiat exchange rate feed that is free and requires no API key?

I'm not averse to enabling price feeds from sources that do require an API key, but we would need to hash out some details before moving forward.

ukane-philemon commented 10 months ago

I'm not averse to enabling price feeds from sources that do require an API key

I really don’t like sources that require an API key but open to suggestions.

ukane-philemon commented 10 months ago

have you identified a reliable WebSockets fiat exchange rate feed that is free and requires no API key

I recommend Binance, Bittrex, and Kucoin.

ukane-philemon commented 10 months ago

@martonp @JoeGruffins @peterzen, any suggestions?

peterzen commented 10 months ago

Bitvavo has unauthenticated WS support

https://docs.bitvavo.com/

ukane-philemon commented 10 months ago

Bitvavo has unauthenticated WS support

https://docs.bitvavo.com/

Thanks for your suggestion @peterzen. It seems Bitvavo doesn’t have support for DCR-USDT market but I'm yet to check for other markets.