gazbert / bxbot

A simple Bitcoin trading bot written in Java.
MIT License
779 stars 275 forks source link

Multiple Exchange And Exchange Transfers #43

Closed jmlw closed 7 years ago

jmlw commented 7 years ago

Is it possible to perform synchronous trades on multiple exchanges and perform exchange to exchange wallet balance transfers? It appears the trade engine and strategies are only able to support a single exchange at the moment and are not able to support wallet transfers.

gazbert commented 7 years ago

Not at the moment, but it could be done.

Currently, each bot integrates with 1 exchange to keep things simple... and to avoid compromising other 'exchange trading' should it fail - the bot was originally designed to work on 1 exchange and to fail hard and crash if anything unexpected happened.

You'd need to change the config model to support multiple exchanges (like the markets config) and the Trading Engine would need changing so that its control loop executes markets/strats on each exchange - either sequentially in 1 thread, or perhaps a separate thread for each adapter, depending on your requirements.

The wallet transfer capability would be easier to implement - the Trading API would need updating to support this (plus a suitable default op for the existing adapters) for a given exchange id.

As for strats bridging multiple exchanges - I'm assuming arbitrage is on the cards here - there'd need to be significant change to support this: the Strategy API would need updating to notify the strat which exchange the invocation is for... and the Trading API ops would need to accept the exchange id the strategy is wanting to execute on... the Trading Engine would also need a fair bit of work to route these requests back and forth... not rocket science, but a lot smarter than it is now.

This is all great stuff, and it would push the bot a lot further than the noddy sample Bitcoin trading bot I started out with! Sadly, my day-job is limiting the time I can work on BX-bot at the moment - I'm trying to build an Angular admin app for the bot and learn Ethereum smart contract blockchain stuff in my spare time too - but if someone was to fork this project and take it to the next level, I'd be happy to help whenever I get some spare time.

The Angular app and Ethereum stuff I'm working on should be done by Jan/Feb 2017 - I'll be back on BX-bot then.

HTH!

gazbert commented 7 years ago

Closing - currently no plans to support multiple concurrent exchanges.