cryptoeax / arbbot

Arbitrator, a bitcoin/altcoin arbitrage trading bot
https://gitter.im/cryptoeax-arbbot/Lobby
GNU General Public License v3.0
200 stars 78 forks source link

Add exchanges #5

Open remipaeta opened 6 years ago

remipaeta commented 6 years ago

Is it possible to add exchanges ? I can also pay you privately.

remipaeta commented 6 years ago

I tried to add a third exchange but I have errors on Arbitrator.php

kingchenx commented 6 years ago

Its better u wait for the rework code :D And yea, me too interested to add more exchanges

cryptoeax commented 6 years ago

Which exchanges are you interested in @rpcrypto?

kingchenx commented 6 years ago

Hitbtc, kraken, yobit, bitfinex and so... many mores :P

cryptoeax commented 6 years ago

Haha, well sure, but to be honest I didn't really intend to start maintaining this open source project, this sort of happened as a result of the original project getting blocked. :-)

I would be happy to do some work on it if there is a sensible way to fund the development but otherwise my contributions so far was more scratching my own itch... Adding support for exchanges is a lot of work.

cryptoeax commented 6 years ago

If people have any particular exchange they would like to see supported, please feel free to comment here. I'm working on some future improvements including support for some new exchanges.

remipaeta commented 6 years ago

I would like Bleutrade, Cryptopia and Binance

Scorpic1 commented 6 years ago

Please add support Binance, Cryptopia and Yobit. Thanks.

ericfraselle commented 6 years ago

Is it possible to add Bitfitnex, Bitlish, Kraken and GDAX?

cryptoeax commented 6 years ago

Why GDAX? It only supports a few markets so I don't believe supporting it would be that beneficial...

ericfraselle commented 6 years ago

You're right

onesource commented 6 years ago

I would like to see another exchange like Binance added so that I can remove Poloniex before they require the verification of legacy accounts, which requires a SSN.

ericfraselle commented 6 years ago

For me, I can't try the bot because it's no more possible to signup on bittrex for the moment. It's why I would like to add some other exchange. To replace an exchange is it the poloniex.php and/or bittrex.php, the only file(s) to swap with another exchange API?

cryptoeax commented 6 years ago

For me, I can't try the bot because it's no more possible to signup on bittrex for the moment. It's why I would like to add some other exchange.

Yep, I'm very aware of this problem. :-/ Have you seen #54?

To replace an exchange is it the poloniex.php and/or bittrex.php, the only file(s) to swap with another exchange API?

Mostly yes. You also need to provide bot/xchange/map.ID and web/xchange/ID.ico as well. You can use the bleutrade branch as an example. I'd be happy to help answer questions etc. in case you're interested to contribute it back. :-)

beannt commented 6 years ago

I love to have support for coinexchange.io and cryptopia, since there are many pairs with high spread.

ElSaico commented 6 years ago

The Cryptopia API seems to be fairly straightforward - quite similar to Bittrex, despite not being a blatant ripoff very similar like Bleutrade.

https://www.cryptopia.co.nz/Forum/Thread/255 - Public API https://www.cryptopia.co.nz/Forum/Thread/256 - Private API

Maybe I'll get my hands dirty on this; no promises though, since they are quite full these days.

ElSaico commented 6 years ago

Sometimes I really wish the exchanges had sandbox APIs - there's even testing blockchains for BTC and BCH, so why not that?

cryptoeax commented 6 years ago

I love to have support for coinexchange.io and cryptopia, since there are many pairs with high spread.

@rpcrypto is already working on Cryptopia (sadly it is no longer possible to register there and I don't have an account there myself so won't even be able to verify the code myself). It would be nice if you would help with coinexchange.io! If you'd like to work on it, you can use exchange ID 8. If you need help feel free to ask questions either here or on gitter. Thank you!

beannt commented 6 years ago

Sure, I will give a try on coinexchange.io. Since PHP is not my main programming language, it's might take some time, but I willing to contribute.

cryptoeax commented 6 years ago

The Cryptopia API seems to be fairly straightforward - quite similar to Bittrex, despite not being a blatant ripoff very similar like Bleutrade.

https://www.cryptopia.co.nz/Forum/Thread/255 - Public API https://www.cryptopia.co.nz/Forum/Thread/256 - Private API

It would be nice to share code with the Bleutrade class as much as possible, the same way it shares code with Bittrex right now with the BittrexLikeExchange. You may for example be able to inherit from Bleutrade and customize methods like getID(), getName() and so on.

BTW a more like explanation behind exchanges ripping each other off is they buying the same exchange software and customizing it. :-) I doubt each exchange writes their own from scratch.

Sometimes I really wish the exchanges had sandbox APIs - there's even testing blockchains for BTC and BCH, so why not that?

In my experience they for the most part don't have working APIs even... Each one has various bugs that I have had to work around so far, so we are far from that ideal world. :-(

Longer term I think https://github.com/ccxt/ccxt would be a better solution. But longer longer term I have plans to redo the whole bot from scratch so I'm not sure how much time I'd spend on porting existing exchanges to use ccxt...

cryptoeax commented 6 years ago

Sure, I will give a try on coinexchange.io. Since PHP is not my main programming language, it's might take some time, but I willing to contributes.

Thank you, and no worries, PHP isn't my main language either, but it's quite easy to pick up and has great documentation on php.net

One question though. Is this all of the API support they have? http://coinexchangeio.github.io/slate/ I'm afraid this isn't nearly enough, they offer no wallet management or trading APIs...

beannt commented 6 years ago

Just looked at it already. They haven't supported trading api yet. I think I will find another good exchange instead. Skipping coinexchange.io for now, until they release v2 api.

cryptoeax commented 6 years ago

Another option is (if you're up for it) to look at their website with your browser's devtools and poke into their JS code to see what it does. I have done this for Poloniex recently with some success but it obviously takes more time!

beannt commented 6 years ago

That's not bad idea. The hardest thing to do with browser way is dealing with authentication/cookie/captcha/2FA things, might need some time to analyze the method they use , any suggestion? since you known how to work with poloniex before.

beannt commented 6 years ago

I found another exchange instead, tradesatoshi, found some open source on github https://github.com/WorldBot/Trade-Satoshi-API, a good way to start :)

cryptoeax commented 6 years ago

That's not bad idea. The hardest thing to do with browser way is dealing with authentication/cookie/captcha/2FA things, might need some time to analyze the method they use , any suggestion? since you known how to work with poloniex before.

For Poloniex I was trying to construct real time orderbook data from their websocket API (the code isn't in this repo) and was just reading their code to see how it processes the incoming data since their API is undocumented. But the auth issue is a big one, typically exchanges either have an API that uses some kind of HMAC based authentication where you digitally sign each request with your API key (see any of our exchange implementations for examples) or they use a cookie that the exchange sign-in system sets when you use the browser to sign in, and APIs that are hidden behind the latter form of authentication aren't useful for automation through bots very easily.

That being said, these days you can run Firefox and Chrome in headless mode, and there are libraries like https://github.com/GoogleChrome/puppeteer that allow you to automate the browser, so one could potentially look into adding the functionality to log in using puppeteer to the exchange and lift the cookie and give it to the bot, but that would require the account to not have 2FA enabled which is quite insecure. I'm not inclined to accept such changes for security reasons... :)

cryptoeax commented 6 years ago

I found another exchange instead, tradesatoshi, found some open source on github https://github.com/WorldBot/Trade-Satoshi-API, a good way to start :)

OK cool. It's sad that exchange also doesn't have registrations open any more!

cryptoeax commented 6 years ago

A couple of recent Exchange API changes were pushed today (https://github.com/cryptoeax/arbbot/commit/b72135eadb6d0fa74d743e7fec528e00776e0419 and https://github.com/cryptoeax/arbbot/commit/04b1fd587774b6abed31a2ccdf74b8860c7efcdc). This is of interest to those who are implementing new exchanges. You are welcome to ignore the newly added arguments like the existing exchanges do.

beannt commented 6 years ago

That's unlucky, many exchanges closed registration recently. I think I will try binance or kucoin since they have just opened limited registration each day.

Intel1146 commented 6 years ago

hitbtc would be awesome, thanks

thosuperman commented 6 years ago

I think binance would be a good choice, https://github.com/binance-exchange/binance-official-api-docs

cryptoeax commented 6 years ago

I think binance would be a good choice, https://github.com/binance-exchange/binance-official-api-docs

I'm working on an implementation of Binance on top of ccxt. :-)

beannt commented 6 years ago

Nice, many supported exchanges with ccxt. It's seem the right way to do. Some info: Cryptopia have just opened for registration :-)

cryptoeax commented 6 years ago

Yes, I think at this point it's better to wait for my CCXTAdapter class and use it for further exchanges, it makes adding new exchanges much simpler!

cryptoeax commented 6 years ago

I posted the binance branch here: https://github.com/cryptoeax/arbbot/issues/109#issuecomment-358747572 Those who want to use the CCXTAdapter class can start doing so now!