GithubHelp home page GithubHelp logo

invalid request, please check your server timestamp or recv_window when doing _bybitClient.UsdPerpetualApi.Trading.PlaceOrderAsync about bybit.net HOT 6 CLOSED

jkorf avatar jkorf commented on June 15, 2024
invalid request, please check your server timestamp or recv_window when doing _bybitClient.UsdPerpetualApi.Trading.PlaceOrderAsync

from bybit.net.

Comments (6)

toshendradalvi avatar toshendradalvi commented on June 15, 2024 1

I think the problem is Parameter used is recvWindow
"&order_type=Market&position_idx=0&qty=0.1&recvWindow=10000&reduce_only=False&side=Sell"
it should be recv_window (underscore missing ?)

from bybit.net.

JKorf avatar JKorf commented on June 15, 2024 1

I've looked into this, and it turns out that for the Spot API it's recvWindow while for the futures API's it's recv_window. So that's fun. Either way, I've fixed it in the latest version.

I've also added the round trip time of a request as a parameter for the timestamp correction, so hopefully there are less timestamp issues from that version on. The best solution for timestamping issue is still to sync your server time more often with a third party tool.

from bybit.net.

toshendradalvi avatar toshendradalvi commented on June 15, 2024

Just need to increase rece_window timeout , I am setting it in constructor
_bybitClient = new BybitClient(new BybitClientOptions()
{
ApiCredentials = new ApiCredentials(AppConfigurationService.ApiKey, AppConfigurationService.ApiSecret),
LogLevel = LogLevel.Trace,
RequestTimeout = TimeSpan.FromSeconds(60),
ReceiveWindow = new TimeSpan(0,0,30),
});
but it's still 5000 when doing _bybitClient.UsdPerpetualApi.Trading.PlaceOrderAsync(....)
Not sure why 30 sec is not comes in to play ?

from bybit.net.

JanKorf avatar JanKorf commented on June 15, 2024

Hm that sounds like a bug. When setting it like that in the client options it should be send as 30 seconds instead of 5 seconds. Either way, the best way to make sure this error doesn't happen is to make sure your server time is synced more often, see:
https://jkorf.github.io/Binance.Net/Timestamping.html
This is for Binance, but the same goes for Bybit

from bybit.net.

a-rahmani1998 avatar a-rahmani1998 commented on June 15, 2024

I think the problem is Parameter used is recvWindow "&order_type=Market&position_idx=0&qty=0.1&recvWindow=10000&reduce_only=False&side=Sell" it should be recv_window (underscore missing ?)

I think you are right, Please update the package @JanKorf

from bybit.net.

mircofx avatar mircofx commented on June 15, 2024

It's still present. Error ret_code 130021. On perpetual usdt.

from bybit.net.

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.