Bitcoin Forum
June 28, 2024, 07:48:09 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Python script to autotrade between wallets and shapeshift  (Read 1216 times)
jza (OP)
Full Member
***
Offline Offline

Activity: 126
Merit: 102


View Profile
November 30, 2015, 02:44:33 AM
 #1

Not sure if this forum allows development outside of bitcoin Core. But I am trying to develop a script that does the following:
- Check wallet is running daemon mode, if not start it.
- Check the price of bitcoin and compare it with the target parameter.
- Get Shapeshift API to issue a trade
- If the price is close to the parameter connect to wallet and issue a payment from Shapeshift deposit address.

I am developing using python and have currently the API from ShapeShiftIO. However if someone have done this or will want to point me to a more robust development I am all ears.
evoorhees
Legendary
*
Offline Offline

Activity: 1008
Merit: 1021


Democracy is the original 51% attack


View Profile
November 30, 2015, 03:49:34 PM
 #2

Awesome!  If we can help in any way, please let us know. You can reach me directly at erik at shapeshift dot io
jza (OP)
Full Member
***
Offline Offline

Activity: 126
Merit: 102


View Profile
December 18, 2015, 08:31:47 PM
 #3

I still have this midway but so far I have been able to issue a transfer.
Code:
from shapeshiftio import ShapeShiftIO
s=ShapeShiftIO()
btc_wallet= 1AtaLyDaswekkERsatkV2kahHDVL4RU1hrmwia
alt_wallet = LZV6twmNyjE1zp45D2BefSVGxd1BJy7Cvx
transfer = {"amount":1, "withdrawal":btc_wallet, "pair":"btc_nbt", "returnAddress":alt_wallet}
s.send_amount(transfer)
s.send_amount(transfer)
{u'success': {u'withdrawalAmount': u'1', u'depositAmount': u'462.1022', u'returnAddress': u'LZV6twmNyjE1zp45D2BefSVGxd1BJy7Cvx ', u'maxLimit': 2098.04266676, u'apiPubKey': u'shapeshift', u'expiration': 1450147115967, u'withdrawal': u'1AtaLyDaswekkERsatkV2kahHDVL4RU1hrmwia', u'pair': u'nbt_btc', u'minerFee': u'0.0001', u'quotedRate': u'0.00216424', u'deposit': u'B8DFEFpxeY7jQMhPe9fq4QKcmroPfwBXqQ'}}

Is still pretty rough, obviously the method would change depending on the type of wallet, web wallet or desktop wallet but it should insert the target addresses of them both. So btc_walllet and alt_coin wallet should get their account addresses on each.

I am still not sure how to get the invoice email destination. Hopefully it could be cleared.
Bit_Happy
Legendary
*
Offline Offline

Activity: 2114
Merit: 1040


A Great Time to Start Something!


View Profile
February 15, 2016, 11:39:23 PM
 #4

A user-friendly version of this idea would be awesome, but I know it is not easy.
Thanks, for the effort so far. Are you still working on the project?

jza (OP)
Full Member
***
Offline Offline

Activity: 126
Merit: 102


View Profile
February 16, 2016, 02:34:53 PM
 #5

I think I did it the challenge is the wallets. Basically is the CLI interface to the local wallet. The web wallets varies a lot from one another and the blockchain.info api is a royal mess.
Too much configuration to make the API work.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!