Have you ever wondered if you can earn profit by buying a coin at one exchange and selling it at another. Well, I've made a simple python script to tell you just that. It queries ask and bid rates from 4 different exchanges, which are, Cryptopia, Bittrex, HitBTC and Poloniex, to show you the results. This kind of trading is known as arbitrage trading. You can find my script at https://github.com/HamidMushtaq/steemtools/blob/master/getarbitragerates.py, and it works with both Python 2 and 3. Here is one sample output of the program. I asked it how much possible profit I can get by trading 10 litecoins. I asked that two times, and both times, it said that it is best to buy from Cryptopia and sell it at Bittrex. Here, of course I am ignoring the transaction fees. Withdrawal fees are not included either, but they can be avoided anyway, by keeping stock of both litecoins and bitcoins on both exhanges.  One interesting result is that of STEEM, which I queried the third time. Apparently, I can get a lot of profit by buying from Poloniex and selling it at HitBTC. However, don't be fooled by this, because if you check, you'll notice that the wallet of STEEM at HitBTC is still under maintenance. So, basically, this type of trade is not even possible. In my Python program, I have got information from these exchanges, using their REST APIs. The information is then extracted from the resulting output in JSON form. Although, in my code, I have listed the sources from where I got help for these APIs, here I am listing them again. 1. **Cryptopia**: https://www.cryptopia.co.nz/Forum/Thread/255 2. **Poloniex**: https://poloniex.com/support/api/ 3. **Bittrex**: https://bittrex.com/home/api 4. **HitBTC**: https://api.hitbtc.com/?python#rest-api-reference ___ I hope that you will find this program useful. If you have any questions relating to the code, I would be happy to answer them. **UPDATE** I have now also added Binance into the list of exchanges. So, now rates from 5 exchanges are shown.
author | hmushtaq |
---|---|
permlink | a-python-program-to-see-if-arbitrage-trading-is-profitable |
category | utopian-io |
json_metadata | {"tags":["utopian-io","cryptocurrency","crypto","programming","python"],"image":["https://steemitimages.com/DQmdFiBzm92wHwFRCdDEVJfMf8rzY9a64DFuMPSvcV18NKw/image.png"],"links":["https://github.com/HamidMushtaq/steemtools/blob/master/getarbitragerates.py","https://www.cryptopia.co.nz/Forum/Thread/255","https://poloniex.com/support/api/","https://bittrex.com/home/api","https://api.hitbtc.com/?python#rest-api-reference"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-02-04 14:36:51 |
last_update | 2018-02-04 19:03:36 |
depth | 0 |
children | 10 |
last_payout | 2018-02-11 14:36:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 3.386 HBD |
curator_payout_value | 0.735 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,101 |
author_reputation | 5,954,376,833,183 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,902,713 |
net_rshares | 602,606,577,399 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
alangrant | 0 | 1,719,231,248 | 100% | ||
vinode | 0 | 799,297,953 | 100% | ||
ilyastarar | 0 | 40,973,310,874 | 33% | ||
hamzayousaf | 0 | 42,309,378,893 | 100% | ||
hmushtaq | 0 | 36,970,085,665 | 100% | ||
jtthefoodie | 0 | 15,321,454,726 | 100% | ||
engramanullah | 0 | 10,525,438,993 | 100% | ||
coolguy123 | 0 | 19,447,296,239 | 7% | ||
astrizak | 0 | 559,478,986 | 100% | ||
pranto | 0 | 200,235,275 | 100% | ||
bestssnahid4 | 0 | 457,100,649 | 100% | ||
iamafra | 0 | 1,686,538,744 | 2% | ||
hrishikesh | 0 | 403,887,690 | 100% | ||
loneminder | 0 | 563,017,800 | 100% | ||
clanbwarclan | 0 | 363,962,883,826 | 24% | ||
bitpost | 0 | 355,956,563 | 100% | ||
krenter | 0 | 2,689,628,692 | 100% | ||
m3mt | 0 | 1,042,009,668 | 5% | ||
aaronwashere | 0 | 546,289,305 | 100% | ||
leoumesh | 0 | 259,827,204 | 100% | ||
mercurybot | 0 | 58,223,402,052 | 2.12% | ||
claraquarius | 0 | 1,870,933,267 | 5% | ||
omnithumbs | 0 | 283,292,331 | 100% | ||
lordjames | 0 | 616,173,959 | 100% | ||
taslimabegum | 0 | 362,946,681 | 100% | ||
jauharialz | 0 | 457,480,116 | 100% |
Good and useful effort, nice program, email me if you can expand it to other exchanges and cryptos... hadi.k.esfahani@gmail.com @bitpost
author | bitpost |
---|---|
permlink | re-hmushtaq-a-python-program-to-see-if-arbitrage-trading-is-profitable-20180204t145046710z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"users":["bitpost"],"app":"steemit/0.1"} |
created | 2018-02-04 14:50:45 |
last_update | 2018-02-04 14:50:45 |
depth | 1 |
children | 0 |
last_payout | 2018-02-11 14:50:45 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.034 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 136 |
author_reputation | 137,732,233,960 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,905,815 |
net_rshares | 5,373,558,962 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
hmushtaq | 0 | 5,373,558,962 | 15% |
Bittrex, Poloniex are my favorite exchanging sites. so what about HitBTC because i havn't used this site?
author | hamzayousaf |
---|---|
permlink | re-hmushtaq-a-python-program-to-see-if-arbitrage-trading-is-profitable-20180204t185831205z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-02-04 18:58:30 |
last_update | 2018-02-04 18:58:30 |
depth | 1 |
children | 1 |
last_payout | 2018-02-11 18:58:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.306 HBD |
curator_payout_value | 0.046 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 106 |
author_reputation | 38,737,399,354,190 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,955,445 |
net_rshares | 52,043,569,276 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
hamzayousaf | 0 | 41,498,914,199 | 100% | ||
hmushtaq | 0 | 10,544,655,077 | 30% |
HitBTC is not bad too. But after adding Binance into the list of exchanges for this program, I can see that Binance has the lowest rates.
author | hmushtaq |
---|---|
permlink | re-hamzayousaf-re-hmushtaq-a-python-program-to-see-if-arbitrage-trading-is-profitable-20180204t190502882z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-02-04 19:05:03 |
last_update | 2018-02-04 19:05:03 |
depth | 2 |
children | 0 |
last_payout | 2018-02-11 19:05:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.178 HBD |
curator_payout_value | 0.058 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 137 |
author_reputation | 5,954,376,833,183 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,956,698 |
net_rshares | 35,344,445,681 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
hmushtaq | 0 | 35,344,445,681 | 100% |
this information is very useful for me. in the future i will try.
author | jauharialz |
---|---|
permlink | re-hmushtaq-a-python-program-to-see-if-arbitrage-trading-is-profitable-20180204t144240842z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-02-04 14:42:21 |
last_update | 2018-02-04 14:42:21 |
depth | 1 |
children | 0 |
last_payout | 2018-02-11 14:42:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 65 |
author_reputation | 4,305,757,255,451 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,903,996 |
net_rshares | 1,934,481,226 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
hmushtaq | 0 | 1,934,481,226 | 5% |
I can see a great and depth passion of yours in programmingπ
author | leoumesh |
---|---|
permlink | re-hmushtaq-a-python-program-to-see-if-arbitrage-trading-is-profitable-20180205t021712454z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-02-05 02:17:15 |
last_update | 2018-02-05 02:17:15 |
depth | 1 |
children | 0 |
last_payout | 2018-02-12 02:17:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.030 HBD |
curator_payout_value | 0.007 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 60 |
author_reputation | 212,340,493,251,438 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 35,028,571 |
net_rshares | 6,241,271,856 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
hmushtaq | 0 | 6,241,271,856 | 16% |
Humm, the only downside to his would be the feeds for moving coins around from one exchange to another and the time it takes, i would rather focus in trading in the same exchange, but nevertheless it is a good tool if you know how to use it, thanks for sharing it.
author | m3mt |
---|---|
permlink | re-hmushtaq-a-python-program-to-see-if-arbitrage-trading-is-profitable-20180204t155219465z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-02-04 15:52:18 |
last_update | 2018-02-04 15:52:18 |
depth | 1 |
children | 1 |
last_payout | 2018-02-11 15:52:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.034 HBD |
curator_payout_value | 0.011 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 264 |
author_reputation | 276,485,595,715 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,918,312 |
net_rshares | 7,097,384,516 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
hmushtaq | 0 | 7,097,384,516 | 20% |
Basically moving of the coins can be avoided if you keep a stock of BTC and the other coin on both exchanges. But like you said, trading is definitely more profitable if you do it right. One interesting phenomena I have observed is that when the values of other cryptos are goin down, the value of digixdao goes up and vice versa. That is because digixdao is backed by gold. I'll make a post about that soon. But first, I have to observe things more in depth.
author | hmushtaq |
---|---|
permlink | re-m3mt-re-hmushtaq-a-python-program-to-see-if-arbitrage-trading-is-profitable-20180204t163837057z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-02-04 16:38:39 |
last_update | 2018-02-04 16:39:18 |
depth | 2 |
children | 0 |
last_payout | 2018-02-11 16:38:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.202 HBD |
curator_payout_value | 0.054 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 459 |
author_reputation | 5,954,376,833,183 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,927,860 |
net_rshares | 37,806,728,376 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
hmushtaq | 0 | 35,722,709,039 | 100% | ||
m3mt | 0 | 2,084,019,337 | 10% |
You got a 2.12% upvote from @mercurybot courtesy of @hmushtaq!
author | mercurybot |
---|---|
permlink | re-hmushtaq-a-python-program-to-see-if-arbitrage-trading-is-profitable-20180206t093202293z |
category | utopian-io |
json_metadata | {"app":"postpromoter/1.7.4"} |
created | 2018-02-06 09:32:00 |
last_update | 2018-02-06 09:32:00 |
depth | 1 |
children | 0 |
last_payout | 2018-02-13 09:32:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 62 |
author_reputation | 732,353,368,070 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 35,360,872 |
net_rshares | 0 |
I will try thank you
author | pranto |
---|---|
permlink | re-hmushtaq-a-python-program-to-see-if-arbitrage-trading-is-profitable-20180204t143916219z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-02-04 14:39:15 |
last_update | 2018-02-04 14:39:15 |
depth | 1 |
children | 0 |
last_payout | 2018-02-11 14:39:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 20 |
author_reputation | 4,636,466,930,802 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,903,296 |
net_rshares | 0 |
author | taslimabegum |
---|---|
permlink | re-hmushtaq-a-python-program-to-see-if-arbitrage-trading-is-profitable-20180204t143818024z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-02-04 14:38:18 |
last_update | 2018-02-04 14:38:18 |
depth | 1 |
children | 0 |
last_payout | 2018-02-11 14:38:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.022 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 56 |
author_reputation | 1,231,512,563,619 |
root_title | "A Python program to see if arbitrage trading is profitable" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,903,064 |
net_rshares | 3,851,174,826 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
hmushtaq | 0 | 3,654,020,094 | 10% | ||
pranto | 0 | 197,154,732 | 100% |