knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.84k stars 1.94k forks source link

[BITFINEX] Trading service error #3050

Open DankaHajnik opened 5 years ago

DankaHajnik commented 5 years ago

When I create exchange instance, BitfinexExchange has a nonceFactory = new AtomicLongIncrementalTime2013NonceFactory() But if I try to get my trading history or balances, I get a response "Nonce is too small.". When I changed nonceFactory from AtomicLongIncrementalTime2013NonceFactory to CurrentTimeNonceFactory, it works good. Nobody has this problem?

sid12345678910 commented 5 years ago

while i didn't have to same error i did have "Nonce is too small." error many times. It turns out i was requesting exchange factory twice in my code whenever i traded in my program. I solved the issue by removing the bitfinex = ExchangeFactory.INSTANCE.createExchange(BitfinexExchange.class.getName()); bitfinex = BitfinexDemoUtils.createExchange(); in my trade code.

maybe this might help but i am not sure

garciapd commented 5 years ago

@DankaHajnik do you have several instances of the Bitfinex exchange? That will happen if you are using the same apiKey through different clients (or instances)