Author Topic: BitUSD Market Maker Live  (Read 18052 times)

0 Members and 1 Guest are viewing this topic.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
also check out riverheads fork and maybe my fork if you are interested

related thread:
https://bitsharestalk.org/index.php?topic=9717.0;all

Offline Riverhead

Try this. It's the submodule that was in there:


https://github.com/freetradebots/btsx_bots


Offline bitandrew

  • Jr. Member
  • **
  • Posts: 34
    • View Profile
Delegate: andrew.btsdacs
Bts: btsfang

Offline maqifrnswa

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
@tonyk: that is where the content of the GuI is located .. the gui itself is written in QT any basically just a browser for a website .. the website (that shows your balances, markets etc...) is written in angularJS and can also be (with some extra effort) used in firefox (or any other browser)

that line just points to the website/angularjs files for the content of the gui

It's interesting, the website is actually encoded and compiled into the binary, so you don't need to distribute the website files - just the binary. Pretty smart way to bootstrap both a market gui and the first website/web wallet.
maintains an Ubuntu PPA: https://launchpad.net/~showard314/+archive/ubuntu/bitshares [15% delegate] wallet_account_set_approval maqifrnswa true [50% delegate] wallet_account_set_approval delegate1.maqifrnswa true

Offline tonyk

  • Hero Member
  • *****
  • Posts: 3308
    • View Profile
Finally.

The one with the syntax error in main.py finally worked for me on Windows!   :) :)

Thank you all for the help!

Lack of arbitrage is the problem, isn't it. And this 'should' solves it.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
@tonyk: that is where the content of the GuI is located .. the gui itself is written in QT any basically just a browser for a website .. the website (that shows your balances, markets etc...) is written in angularJS and can also be (with some extra effort) used in firefox (or any other browser)

that line just points to the website/angularjs files for the content of the gui

Offline tonyk

  • Hero Member
  • *****
  • Posts: 3308
    • View Profile
Thanks Riverhead and maqifrnswa.
Still can not make it work, though..
 now I guess it is too general of an issue but:

Code: [Select]
Traceback (most recent call last):
  File "C:\Users\Toni\bitshares_toolkit\programs\market_maker\main.py", line 27,
 in <module>
    conf["client"]["rpc_user"],
KeyError: 'client'

make sure you followed the instructions: clone the whole directory and edit config.py with your information

I know my questions will be better placed in the 'Stupid question' thread but:
what this line in the BTSX client config.json should reflect?
Code: [Select]
"htdocs": "./htdocs"
I saw here  https://bitsharestalk.org/index.php?topic=9010.msg116943#msg116943 it is changed to what seems the location of the executable for the BTSX client.
Lack of arbitrage is the problem, isn't it. And this 'should' solves it.

Offline maqifrnswa

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Thanks Riverhead and maqifrnswa.
Still can not make it work, though..
 now I guess it is too general of an issue but:

Code: [Select]
Traceback (most recent call last):
  File "C:\Users\Toni\bitshares_toolkit\programs\market_maker\main.py", line 27,
 in <module>
    conf["client"]["rpc_user"],
KeyError: 'client'

make sure you followed the instructions: clone the whole directory and edit config.py with your information
maintains an Ubuntu PPA: https://launchpad.net/~showard314/+archive/ubuntu/bitshares [15% delegate] wallet_account_set_approval maqifrnswa true [50% delegate] wallet_account_set_approval delegate1.maqifrnswa true

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Fixed a bug in btsx.py (cancel_all_orders). Can I push the fix up to freetradebots/btsx_bots?

yes, make a pull request and/or give me your github name for push permissions
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline Riverhead

Fixed a bug in btsx.py (cancel_all_orders). Can I push the fix up to freetradebots/btsx_bots?

Offline Riverhead

Thanks toast. My bot required a new method in the btsx class , "get_last_fill"

Code: [Select]
    def get_last_fill (self, asset1, asset2):
        last_fill = -1
        response = self.request("blockchain_market_order_history", [asset1, asset2, 0, 1])
        for order in response.json()["result"]:
            last_fill = float(order["ask_price"]["ratio"]) * 10
        return last_fill

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
This should be a submodule so I have made a new repo and pulled in riverhead's bot.

https://github.com/freetradebots/btsx_bots

You mostly want to be adding files to the bots/ or feeds/ folders. I'll add examples too. This should be fun.
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
awesome .. I remember something like this from mtgox .. cant remember the name though :)
will try for sure .. for the fun .. 10$ ;-)

Offline Riverhead


UPDATE: THIS IS NOW IN https://github.com/freetradebots/btsx_bots

I have published my speculator bot to git. It's very rough (I don't really know Python) and will probably bankrupt you if you run it against your main account.

This is only being published because people have been asking me about it and it has the potential to create a lot of market traffic.

1) If you have more than 10 bitUSD in your account create a bid for BTSX at 2% above your last ask price (uses last fill price if this is the first time through)

2) If you have more than 500 BTSX in your account create an ask for bitUSD at 2% percent above your last bid price (uses last fill price if this is the first time through)

3) If the last fill price moves by more than 5% then cancel all your orders and rerun steps 1 and 2

4) Repeat forever.

Code: [Select]
This is a very simple bot based on the Market Maker bot
for BitSharesX. This takes logic started by "toast" and
massaged by Riverhead.

IT IS HIGHLY RECOMMENDED YOU SETUP A BOT WALLET/ACCOUNT WITH
LIMITED FUNDS. IF YOU RUN THIS AGAINST YOUR PRIMARY WALLET
REALLY "BAD THINGS" COULD HAPPEN.

The purpose of this bot is:
1) Create a simple bot as a base to create more complex bots
2) Generate traffic in the bitUSD:BTSX market

SETUP:
- Modify the config.json to reference your own RPC configutarion.
- Fund your bot account with at least 501 BTSX


https://github.com/freetradebots/btsx_bots
« Last Edit: September 17, 2014, 06:10:30 pm by Riverhead »

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
My bot often stuck while fetching price feed from bter or btc38 (pool Internet connection :().

I think it's better to add a timeout parameter while fetching..

feeds/bter.py
Code: [Select]
bitstamp_data = json.load(urllib2.urlopen(req, timeout=5))
...
btsx_data = json.load(urllib2.urlopen(req, timeout=5))

feeds/btc38.py (several lines)
Code: [Select]
response = requests.get(url=url, headers=self.headers, params=params, timeout=5)
BitShares committee member: abit
BitShares witness: in.abit