bitfinexcom / bitfinex-api-node

BITFINEX NodeJS trading API - Bitcoin, Litecoin, and Ether exchange
https://www.bitfinex.com/
MIT License
462 stars 213 forks source link

Error: invalid auth seq # when cancelling order on finex #208

Closed hems closed 6 years ago

hems commented 6 years ago

I just noticed when i cancel an order opened via the API using the Bitfinex UI i get:

Error: invalid auth seq #; last 15, got 104706

I'm using ws(2)

How to avoid this error?

nikulinsanya commented 6 years ago

Seems, the problem is in the wrong order of posting orders. You post several orders and some of them come to bitfinex earlier than prev orders.

hems commented 6 years ago

@nikulinsanya thanks, i'll have a closer look at this when i get back to my app.

f3rno commented 6 years ago

@hems this is interesting; I'll try to reproduce this week, you may be onto something. It sounds like the sequence # differs if the packet is generated by an action in the UI. Needs verification.

nikulinsanya commented 6 years ago

seems I fixed it setting seqAudit to false.

hems commented 6 years ago

@nikulinsanya interesting, i hadn't noticed that seqAudit property on the documentation