ctubio / Krypto-trading-bot

Self-hosted crypto trading bot (automated high frequency market making) written in C++
https://127.0.0.1:3000
Other
3.37k stars 823 forks source link

Question: Why are trades not sent with websocket if possible ? #105

Closed Camille92 closed 7 years ago

Camille92 commented 7 years ago

Hey Carles,

Just a question, why are trades not sent with websocket ? It's faster and there's no API limit on that channel (so no need to worry about API delay :) ).

ctubio commented 7 years ago

what exchange you mean? each exchange has its own reasoning

Camille92 commented 7 years ago

Bitfi ! Because I think the cause of the 'STOPPED' and the implementation of API delay was because of bitfinex low limit right?

So I was thinking, if we don't use rest API at all and only Websocket, then there is no way to reach a limit because there is none :)

ctubio commented 7 years ago

Bitfinex uses websocket api v2 to send/cancel orders, see https://github.com/ctubio/Krypto-trading-bot/blob/master/src/server/gateways/bitfinex.ts#L240-L241

Camille92 commented 7 years ago

Okay but then there is something I don't understand. Where do we use REST then? and why?

And if we don't use REST then there is really no need for API delay on Bitfi right?

ctubio commented 7 years ago

solved in IRC channel; you're right