Giter Club home page Giter Club logo

Comments (8)

alexander-hagen avatar alexander-hagen commented on July 17, 2024 1

Looks good. Great job!

from coinbase-pro-node.

alexander-hagen avatar alexander-hagen commented on July 17, 2024

Troubleshooting so far shows that this occurs at times when rate limiting is active.

from coinbase-pro-node.

bennycode avatar bennycode commented on July 17, 2024

Hi @alexander-hagen, I guess that there is a call to getTime() every time you make a call to listAccounts(), am I right with that? If yes, then we can maybe cache the result of getTime() and only do it whenever this time skew gets outdated. This could save a lot of requests to Coinbase Pro.

from coinbase-pro-node.

alexander-hagen avatar alexander-hagen commented on July 17, 2024

For every REST call, there also is a request to GET /time. I was thinking to get rid of skew altogether as CoinbasePro permits requests with up to 30 seconds time discrepancy. Alternatively, periodically updating is perhaps a better alternative.

from coinbase-pro-node.

bennycode avatar bennycode commented on July 17, 2024

Let's do the caching approach: We fetch the skew once and when Coinbase Pro reports that the time is out of sync, we will update it.

from coinbase-pro-node.

alexander-hagen avatar alexander-hagen commented on July 17, 2024

I now also have a case where it happens while there no rate limiting. It still may be related to the GET /time though. I will do some tests without the GET /time and let you know

from coinbase-pro-node.

bennycode avatar bennycode commented on July 17, 2024

Hi @alexander-hagen, I built caching for the time skew. Can you please try [email protected]?

from coinbase-pro-node.

alexander-hagen avatar alexander-hagen commented on July 17, 2024

OK, let me have a try. I have been running with local time only for the past past week and didn't have any the issue since then:

    getTime() {
        return __awaiter(this, void 0, void 0, function* () {
          const now=new Date();
          const epoch=now / 1000;
          const iso=now.toISOString();
          const data={"iso": now,"epoch": epoch};
          return data;
        });
    }

from coinbase-pro-node.

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.