Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Binance] Rate Limitation error on myTrades calls #4113

Open
trixprod opened this issue Jun 8, 2021 · 6 comments
Open

[Binance] Rate Limitation error on myTrades calls #4113

trixprod opened this issue Jun 8, 2021 · 6 comments

Comments

@trixprod
Copy link
Contributor

trixprod commented Jun 8, 2021

Hello, does the rate limitation system works properly on Binance ?
I've got some API error on calling myTrades.

Here is the stack trace
org.knowm.xchange.binance.dto.BinanceException: Too much request weight used; current limit is 1200 request weight per 1 MINUTE. Please use the websocket for live updates to avoid polling the API. (HTTP status code: 429) at jdk.internal.reflect.GeneratedConstructorAccessor230.newInstance(Unknown Source) at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:124) at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:283) at com.fasterxml.jackson.databind.deser.ValueInstantiator.createFromObjectWith(ValueInstantiator.java:229) at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:198) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:422) at com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer.deserializeFromObject(ThrowableDeserializer.java:65) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at si.mazi.rescu.serialization.jackson.JacksonResponseReader.read(JacksonResponseReader.java:53) at si.mazi.rescu.serialization.jackson.JacksonResponseReader.readException(JacksonResponseReader.java:58) at si.mazi.rescu.ResponseReader.read(ResponseReader.java:82) at si.mazi.rescu.RestInvocationHandler.mapInvocationResult(RestInvocationHandler.java:175) at si.mazi.rescu.RestInvocationHandler.receiveAndMap(RestInvocationHandler.java:163) at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:119) at com.sun.proxy.$Proxy308.myTrades(Unknown Source) at org.knowm.xchange.binance.service.BinanceTradeServiceRaw.lambda$myTrades$7(BinanceTradeServiceRaw.java:191) at org.knowm.xchange.binance.service.BinanceTradeServiceRaw$$Lambda$1559/0x00000000100ee0c0.call(Unknown Source) at org.knowm.xchange.client.ResilienceUtils$DecorateCallableApi.call(ResilienceUtils.java:74) at org.knowm.xchange.binance.service.BinanceTradeServiceRaw.myTrades(BinanceTradeServiceRaw.java:203) at org.knowm.xchange.binance.service.BinanceTradeService.getTradeHistory(BinanceTradeService.java:265)

Thank you

@walec51
Copy link
Collaborator

walec51 commented Jun 8, 2021

did you turn it on in the exchanges specification?

its off by default for backwards compatibility

@walec51
Copy link
Collaborator

walec51 commented Jun 8, 2021

if you turned it on then we would have to check if they changes the weights

the current rule for this endpoint is defined in:

@trixprod
Copy link
Contributor Author

trixprod commented Jun 8, 2021

@walec51 , i thought it was enabled by default.

if (exSpec.getResilience() != null) { exSpec.getResilience().setRateLimiterEnabled(true); exSpec.getResilience().setRetryEnabled(true); }

That's right ?

@trixprod
Copy link
Contributor Author

trixprod commented Jun 9, 2021

I've tried with resilience, same result :

org.knowm.xchange.binance.dto.BinanceException: Too much request weight used; current limit is 1200 request weight per 1 MINUTE. Please use the websocket for live updates to avoid polling the API. (HTTP status code: 429) at jdk.internal.reflect.GeneratedConstructorAccessor198.newInstance(Unknown Source) at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:124) at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:283) at com.fasterxml.jackson.databind.deser.ValueInstantiator.createFromObjectWith(ValueInstantiator.java:229) at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:198) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:422) at com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer.deserializeFromObject(ThrowableDeserializer.java:65) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at si.mazi.rescu.serialization.jackson.JacksonResponseReader.read(JacksonResponseReader.java:53) at si.mazi.rescu.serialization.jackson.JacksonResponseReader.readException(JacksonResponseReader.java:58) at si.mazi.rescu.ResponseReader.read(ResponseReader.java:82) at si.mazi.rescu.RestInvocationHandler.mapInvocationResult(RestInvocationHandler.java:175) at si.mazi.rescu.RestInvocationHandler.receiveAndMap(RestInvocationHandler.java:163) at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:119) at com.sun.proxy.$Proxy312.myTrades(Unknown Source) at org.knowm.xchange.binance.service.BinanceTradeServiceRaw.lambda$myTrades$7(BinanceTradeServiceRaw.java:191) at org.knowm.xchange.binance.service.BinanceTradeServiceRaw$$Lambda$1545/0x0000000074138f70.call(Unknown Source) **at org.knowm.xchange.client.ResilienceUtils$DecorateCallableApi.call(ResilienceUtils.java:74)** at org.knowm.xchange.binance.service.BinanceTradeServiceRaw.myTrades(BinanceTradeServiceRaw.java:203) at org.knowm.xchange.binance.service.BinanceTradeService.getTradeHistory(BinanceTradeService.java:265) ... 31 common frames omitted

@walec51
Copy link
Collaborator

walec51 commented Jun 14, 2021

ok, I'll check if some request weight values changes at binance ware made on the weekend

@jsloane
Copy link

jsloane commented Sep 8, 2021

I'm also seeing this error. Is there a work around available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants