wnz99 / tvcd

A JS module to fetch realtime candles data from various crypto exchanges. Created to feed TradingView chart.
11 stars 6 forks source link

Invalid timeframe request on Bitfinex triggers loads of requests #51

Closed hems closed 1 year ago

hems commented 1 year ago

Today i accidentally tried to ask for 3H candle instead of 3h candle for Bitfinex.

For some reason it triggered tons of requests for Bitfinex and screwed my rate limit.

image

Those are some expectations / suggestions

wnz99 commented 1 year ago

hmm, I'll go for the 3rd option, the library will now check if an interval is supported and, if not, it will throw an error: https://github.com/wnz99/tvcd/pull/61

The other options would be good to, but there are a few tricky potential issues, for example 1M is for months, so it would clash with 1m for minutes.

I remember I took inspiration from bitfinex for the naming. Bitfines has:

TimeFrame
string
required

Available values: '1m', '5m', '15m', '30m', '1h', '3h', '6h', '12h', '1D', '1W', '14D', '1M'
hems commented 1 year ago

Good point!

Maybe we could use 30d or 30D instead of 1M tough as that is really unusual timeframe to be used it wouldn't affect most people.

Maybe worth checking how vercel does the 30D thing: https://github.com/vercel/ms