Coder Social home page Coder Social logo

Comments (10)

carlosmiei avatar carlosmiei commented on September 22, 2024

Hello @jtashiro, we will take that into consideration but those endpoints are only called "once per instance", to cache and load the markets so it shouldn't have that much impact.

from ccxt.

jtashiro avatar jtashiro commented on September 22, 2024

Hello @jtashiro, we will take that into consideration but those endpoints are only called "once per instance", to cache and load the markets so it shouldn't have that much impact.

I'm comparing 4.2.51 to 4.3.28 to identify the change that is causing me to encounter 429 Too Many Requests, when running the same python scripts. 4.2.51 works fine, no issue with 429, but 4.3.28 fails in the same spot each time on the public method I highlighted above.

4.2.51 fetch_tickers_v3() -> v3PrivateGetBrokerageProducts()
4.3.28 fetch_tickers_v3() -> v3PublicGetBrokerageMarketProducts()

Question is why was this changed to the public methods in 4.3?

I dont see a way to avoid hitting the rate limit when using the public methods and would need to refactor a lot of code to either introduce some back off throttling for no good reason.

I'll look further but the most straight forward for me was to replace the public with private methods as noted earlier.

from ccxt.

carlosmiei avatar carlosmiei commented on September 22, 2024

@jtashiro

Question is why was this changed to the public methods in 4.3?

We did this because for accessing public data like markets/candles/tickers/trades it should not be needed to have an account with the exchange, most exchanges provide this information publicly and we wanted to keep the same approach here.

from ccxt.

jtashiro avatar jtashiro commented on September 22, 2024

Given the lower rate limit that is enforced on public apis, can these wrapper methods use the private methods when apiKeys present? That would make it transparent and not require an optional setting.

from ccxt.

carlosmiei avatar carlosmiei commented on September 22, 2024

@jtashiro I think it would be more "transparent" using the option. Which unified methods do you intend to use the private endpoints? fetchTicker/OHLCV/Trades ?

from ccxt.

jtashiro avatar jtashiro commented on September 22, 2024

Yes those and any others - basically when API keys are present, use the private methods. But sounds like you are a fan of the option technique to drive that behavior instead of hiding that logic ?

from ccxt.

ttodua avatar ttodua commented on September 22, 2024

@carlosmiei is right, hiding it is not a good approach, we definitely have to offer an option so user could control it.
i'll be adding this shortly.

from ccxt.

ttodua avatar ttodua commented on September 22, 2024

I've linked PR. after it's merged and new package published, you can use ex.options['usePrivateEndpointsIfApikeysPresent'] = true (the keyname might be changed before merging, keep an eye on it), so thereafter all requests will use private endpoints (if api keys are present)

from ccxt.

carlosmiei avatar carlosmiei commented on September 22, 2024

@jtashiro Ok we just released a new version (4.3.32) with the changes, you can set exchange.options['usePrivate'] = True or provide usePrivate: True in params upon calling fetchTrades/OHLCV/ticker/Orderbook.

Let us know if anything!

from ccxt.

jtashiro avatar jtashiro commented on September 22, 2024

from ccxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.