Author Topic: BitUSD Market Maker Live  (Read 18179 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

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'



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

Offline maqifrnswa

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Trying to run this baby on windows

got this
Code: [Select]
C:\Users\Toni\bitshares_toolkit\programs\market_maker>main.py C:\Users\Toni\AppD
ata\Roaming\BitShares
Traceback (most recent call last):
  File "C:\Users\Toni\bitshares_toolkit\programs\market_maker\main.py", line 10,
 in <module>
    from btsx import BTSX
  File "C:\Users\Toni\bitshares_toolkit\programs\market_maker\btsx.py", line 3,
in <module>
    import requests
ImportError: No module named requests

- Changed all 'account' occurrences to 'account_name' in btsx.py.
- Also I open the wallet before starting the bot - should I do that? (ie the wallet is in 'wbot1 (unlocked) >>>' state..)
- Also should I actually use port 8000 or the ones provided by the BTSX client?

the requests module is not installed, see:
http://stackoverflow.com/questions/17309288/importerror-no-module-named-requests

yes, unlock the wallet (partly why people suggest having a separate trader wallet)
yes, use the rpc http port provided by/to the BTSX client
« Last Edit: September 16, 2014, 09:40:47 pm by maqifrnswa »
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
Trying to run this baby on windows

got this
Code: [Select]
C:\Users\Toni\bitshares_toolkit\programs\market_maker>main.py C:\Users\Toni\AppD
ata\Roaming\BitShares
Traceback (most recent call last):
  File "C:\Users\Toni\bitshares_toolkit\programs\market_maker\main.py", line 10,
 in <module>
    from btsx import BTSX
  File "C:\Users\Toni\bitshares_toolkit\programs\market_maker\btsx.py", line 3,
in <module>
    import requests
ImportError: No module named requests

- Changed all 'account' occurrences to 'account_name' in btsx.py.
- Also I open the wallet before starting the bot - should I do that? (ie the wallet is in 'wbot1 (unlocked) >>>' state..)
- Also should I actually use port 8000 or the ones provided by the BTSX client?

« Last Edit: September 16, 2014, 09:31:53 pm by tonyk »
Lack of arbitrage is the problem, isn't it. And this 'should' solves it.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
Anyone has any profit generated?
I saw no transaction done with the default config..
BitShares committee member: abit
BitShares witness: in.abit

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
... and less buggy than the GUI :)

Offline Riverhead

I think my for-profit bot is working. Just time consuming to test. I'll post it up once it's done a few successful trades.


One nice thing about working on this is I'm getting more comfortable with the CLI. It's very fast and nicely formatted output.


Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
you just need a python interpreter:
windows:  http://www.activestate.com/activepython/downloads

but don't expect a fancy GUI .. yet (toast?) ;-)

Offline Gentso1

  • Hero Member
  • *****
  • Posts: 931
    • View Profile
  • BitShares: gentso
any progress on the windows version of the bot?

Offline Riverhead

It should match the def line

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
Should this line
response = self.request("wallet_market_order_list", [base, quote, -1, account])
change to
response = self.request("wallet_market_order_list", [base, quote, -1, account_name])
?
Check your bots!


Recent price changes have caused the 15RC1 release market_maker to cancel some orders. The btsx.py cancel_bids_less_than and cancel_bids_out_of_range references account instead of account_name which causes a crash. Have a look and make sure your bot is still running.


Fix is to change the def to account_name like the other functions.

Code: [Select]
    def cancel_bids_less_than(self, account_name, base, quote, price):
        response = self.request("wallet_market_order_list", [base, quote, -1, account])
        order_ids = []
        for pair in response.json()["result"]:
            order_id = pair[0]
            item = pair[1]
            if item["type"] == "bid_order":
                if float(item["market_index"]["order_price"]["ratio"])* (self.BTSX_PRECISION / self.USD_PRECISION) < price:
                    order_ids.append(order_id)
                    log("%s canceled an order: %s" % (account_name, str(item)))
        cancel_args = [[item] for item in order_ids]
        response = self.request("batch", ["wallet_market_cancel_order", cancel_args])
        return cancel_args
BitShares committee member: abit
BitShares witness: in.abit

Offline Riverhead

Check your bots!


Recent price changes have caused the 15RC1 release market_maker to cancel some orders. The btsx.py cancel_bids_less_than and cancel_bids_out_of_range references account instead of account_name which causes a crash. Have a look and make sure your bot is still running.


Fix is to change the def to account_name like the other functions.

Code: [Select]
    def cancel_bids_less_than(self, account_name, base, quote, price):
        response = self.request("wallet_market_order_list", [base, quote, -1, account])
        order_ids = []
        for pair in response.json()["result"]:
            order_id = pair[0]
            item = pair[1]
            if item["type"] == "bid_order":
                if float(item["market_index"]["order_price"]["ratio"])* (self.BTSX_PRECISION / self.USD_PRECISION) < price:
                    order_ids.append(order_id)
                    log("%s canceled an order: %s" % (account_name, str(item)))
        cancel_args = [[item] for item in order_ids]
        response = self.request("batch", ["wallet_market_cancel_order", cancel_args])
        return cancel_args
« Last Edit: September 15, 2014, 01:06:08 pm by Riverhead »

Offline G1ng3rBr34dM4n

Working on getting a market maker bot set up as well.

Big thanks to robrigo for the help so far!

38PTSWarrior

  • Guest
OK, I will go there, but I meant the chat from the website


Offline robrigo

How do I git clone the develop branch? I am almost sure it's not this one: git clone https://github.com/dacsunlimited/bitsharesx

I tried git clone https://github.com/BitShares/bitshares_toolkit/tree/develop/programs/market_maker   but that didn't work.

You had it right initially. git clone will clone the entire git repo; then you can switch to the develop branch by doing:


git checkout develop

Do you have 5 minutes to meet in the chat?

Just logged into #bitshares freenode IRC if you mean that.

38PTSWarrior

  • Guest
How do I git clone the develop branch? I am almost sure it's not this one: git clone https://github.com/dacsunlimited/bitsharesx

I tried git clone https://github.com/BitShares/bitshares_toolkit/tree/develop/programs/market_maker   but that didn't work.

You had it right initially. git clone will clone the entire git repo; then you can switch to the develop branch by doing:


git checkout develop

Do you have 5 minutes to meet in the chat?

Offline Riverhead

I wrote this very crude function to make it easier for me to track the performance of the robot over time. There are already get_balance formulas for the wallet so this is for open orders converted to USD.

I use this to have a window open that just streams the following: "USD total value" "USD Wallet" "BTSX Wallet" "USD Open Orders"

Code: [Select]
2014-0914-08:02:28 413.743444392 3.8038 99.5 406.231799437
2014-0914-08:03:32 413.754224567 3.8038 99.5 406.231799437

This is my first poke at python so the code is probably pretty crude for someone more proficient. This is also hard coded to me and USD/BTSX.


Code: [Select]
    def get_my_costs(self):
        orders_total_cost = 0
        response = self.request("wallet_market_order_list", ["USD", "BTSX", -1, "spikel"])
        for pair in response.json()["result"]:
            item = pair[1]
            order_balance = float(item["state"]["balance"])
            order_ratio = float(item["market_index"]["order_price"]["ratio"])
            if (item["market_index"]["order_price"]["quote_asset_id"] == 22):
                order_amount = (order_balance * order_ratio) / 10000
            else:
                order_amount = order_balance / 10000
            orders_total_cost = (orders_total_cost + order_amount)
        return orders_total_cost

38PTSWarrior

  • Guest
Thank you so much. I was again on autopilot and was doing only cd bitsharesx, make bitshares_client without the git checkout develop. I think I will delete the new files nd do it again. Bot I'm coming =)

Offline robrigo

How do I git clone the develop branch? I am almost sure it's not this one: git clone https://github.com/dacsunlimited/bitsharesx

I tried git clone https://github.com/BitShares/bitshares_toolkit/tree/develop/programs/market_maker   but that didn't work.

You had it right initially. git clone will clone the entire git repo; then you can switch to the develop branch by doing:


git checkout develop

38PTSWarrior

  • Guest
How do I git clone the develop branch? I am almost sure it's not this one: git clone https://github.com/dacsunlimited/bitsharesx

I tried git clone https://github.com/BitShares/bitshares_toolkit/tree/develop/programs/market_maker   but that didn't work.

Offline betax

  • Hero Member
  • *****
  • Posts: 808
    • View Profile
Ive been running the latest no problem for a ~ day, only issue is that the password is before the user name (that confused me for a while doh!).
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline robrigo

I'm in with some little stake .. let's see how to works out ...
can we have a modified version for btiGLD and bitCNY too?

I'm gonna check through the code .. maybe I can figure it out myself :)

There are a couple simple naming inconsistencies I found in the logging from running the latest market maker for a little bit...

In btsx.py:

line 87: "account_name" (no quotes) should be replaced with "account".

I saw another but it looks like it was already fixed.  ;) Those caused my bot to terminate.

38PTSWarrior

  • Guest

Offline cass

  • Hero Member
  • *****
  • Posts: 4311
  • /(┬.┬)\
    • View Profile
I will be making it significantly easier to user today
Now I am expecting a GUI for the bot :-)   8) 8)

 +5% 8)
█║▌║║█  - - -  The quieter you become, the more you are able to hear  - - -  █║▌║║█

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I'm in with some little stake .. let's see how to works out ...
can we have a modified version for btiGLD and bitCNY too?

I'm gonna check through the code .. maybe I can figure it out myself :)

Offline robrigo

The latest develop branch has a revamped market maker bot architecture. I'm designing it in a way where it should be easy for people to write and share trading bots with configurable parameters.

New usage:

python main.py path_to_bot_config.json

It will create a new config with one default bot configured.
Edit this file with rpc client info and your bot settings.
You can look at the top of config.py to read more about the parameters.

Watch this space...

Bot frameworks 4 the win. I'm running it smoothly now alongside my GUI wallet.  8) Thanks toast.

Offline emailtooaj

Sound Editor of Beyondbitcoin Hangouts. Listen to latest here - https://beyondbitcoin.org support the Hangouts! BTS Tri-Fold Brochure https://bitsharestalk.org/index.php/topic,15169.0.html
Tip BROWNIE.PTS to EMAILTOOAJ

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
The latest develop branch has a revamped market maker bot architecture. I'm designing it in a way where it should be easy for people to write and share trading bots with configurable parameters.

New usage:

python main.py path_to_bot_config.json

It will create a new config with one default bot configured.
Edit this file with rpc client info and your bot settings.
You can look at the top of config.py to read more about the parameters.

Watch this space...
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 robrigo

Mine is running:

Code: [Select]
TYPE        QUANTITY            PRICE                         BALANCE             COST                COLLATERAL          ID                                 
================================================================================================================================
bid_order   5,005.18188 BTSX    0.03917587898743254 USD / BTSX196.0824 USD        196.0823 USD        N/A                 7a160369d1c67da0ecf6d9ca719219933f03d39e
ask_order   4,899.80000 BTSX    0.04113467293680417 USD / BTSX4,899.80000 BTSX    201.5516 USD        N/A                 7bd0600b46d2b5f0b1ad5b824335a0b5c96d4c54

Steps I took:

1) git clone the develop branch
2) Do the two submodule commands and then cmake .
3) make bitshares_client
4) ./bitshares_client --data-dir ~/.usd_market_maker
5) create_wallet <whatever>
6) import_private_key <some key from a trading account you created>
7) quit client and update the config.json with your desired user/pass. Add /rpc to the end of the https bit after the port
8 ) download the bot files from BM's link
9) edit main.py with your account name (make sure the account has at least 1001 BTSX and 100 USD (I went 4000/200)
10) python main.py user pass port true

Nice! Putting it in a separate data-dir is definitely a better idea; right now I am seeing problems after exiting the CLI wallet and trying to open the GUI where it isn't connecting me in the GUI. I clicked "Enable Transaction Scanning" but it is just kind of hung there atm. I changed the config.json parameters back to what they originally were but keeping a separate data-dir for this would probably prevent the issue I am seeing.

I will probably rename everything in the data-dir except for the wallet and see if that fixes my issue.

Offline Riverhead

Mine is running:

Code: [Select]
TYPE        QUANTITY            PRICE                         BALANCE             COST                COLLATERAL          ID                                 
================================================================================================================================
bid_order   5,005.18188 BTSX    0.03917587898743254 USD / BTSX196.0824 USD        196.0823 USD        N/A                 7a160369d1c67da0ecf6d9ca719219933f03d39e
ask_order   4,899.80000 BTSX    0.04113467293680417 USD / BTSX4,899.80000 BTSX    201.5516 USD        N/A                 7bd0600b46d2b5f0b1ad5b824335a0b5c96d4c54

Steps I took:

1) git clone the develop branch
2) Do the two submodule commands and then cmake .
3) make bitshares_client
4) ./bitshares_client --data-dir ~/.usd_market_maker
5) create_wallet <whatever>
6) import_private_key <some key from a trading account you created>
7) quit client and update the config.json with your desired user/pass. Add /rpc to the end of the https bit after the port
8 ) download the bot files from BM's link
9) edit main.py with your account name (make sure the account has at least 1001 BTSX and 100 USD (I went 4000/200)
10) python main.py user pass port true

Offline robrigo

I think I have it working now... here are the steps I took:

1) Build bitsharesx repo by following these instructions: http://wiki.bitshares.org/index.php/BuildInstructionsBitSharesX

Except for the "Configuration and Compilation (Core)" step; here i had to change the CMAKE_PREFIX_PATH part of the command:

Code: [Select]
# OSX users only!
export CMAKE_PREFIX_PATH=/usr/local/ssl

cmake -DCMAKE_BUILD_TYPE=Release .
make

2) Copy market_maker program from develop branch of bitshares_toolkit repo over to "programs" in bitsharesx repo. You have to edit "main.py" and replace "local-market-maker" with your local account.

3) Edit config.json in data directory to specify an rpc_user / rpc_password, and set "enable" to true.

4) Run bitshares_client in bitsharesx repo as mentioned here:

https://github.com/BitShares/bitshares_toolkit/wiki/DPOS-initial-delegate-setup

For this step I passed the following flags to run: --rpcuser=user --rpcpassword=***** --server

5) Now, I opened my wallet on the CLI by running

Code: [Select]
wallet_open <NAME>

5) Then I could go into "market_maker" and run it as described in bytemasters original post:

python main.py <RPC_USER> <RPC_PASSWORD> <HTTP_RPC_PORT> <LIVE?>

After I got output like:

Code: [Select]
Initializing with URL:  http://<USER>:<PASSWORD>@localhost:<PORT>/rpc
Init price:  0.038721
Init price:  25.825624
{u'id': 0, u'result': [[u'<LOCAL_ACCOUNT>', [[0, 10000000000]]]]}
[u'<LOCAL_ACCOUNT>', [[0, 10000000000]]]
[[0, 10000000000]]
[0, 10000000000]
0.0
{u'id': 0, u'result': [[u'<LOCAL_ACCOUNT>', [[0, 10000000000]]]]}
[u'<LOCAL_ACCOUNT>', [[0, 10000000000]]]
[[0, 10000000000]]
[0, 10000000000]
100000.0
0.0
Price moved  -  old:  0.038721   new:  0.038721

   u'id':0,
   u'result':{ 
      u'blockchain_head_block_timestamp':u'20140912T170240',
      u'blockchain_average_delegate_participation':85.59322033898304,
      u'wallet_unlocked':False,
      u'wallet_next_block_production_time':None,
      u'blockchain_share_supply':199988581761744,
      u'network_num_connections':0,
      u'blockchain_delegate_pay_rate':155505,
      u'blockchain_next_round_timestamp':u'20140912T171950',
      u'ntp_time_error':-4.27297,
      u'blockchain_random_seed':u'ff8666c7c8c734f737d1005e5862b050aaf0f62a',
      u'blockchain_next_round_time':854,
      u'wallet_block_production_enabled':None,
      u'network_num_connections_max':200,
      u'wallet_last_scanned_block_timestamp':None,
      u'wallet_next_block_production_timestamp':None,
      u'wallet_unlocked_until_timestamp':None,
      u'wallet_open':True,
      u'blockchain_accumulated_fees':18809928977,
      u'blockchain_head_block_num':467948,
      u'blockchain_confirmation_requirement':1,
      u'client_data_dir':u'/Users/rob/Library/Application Support/BitShares X',
      u'blockchain_head_block_age':176,
      u'blockchain_blocks_left_in_round':86,
      u'wallet_unlocked_until':None,
      u'ntp_time':u'20140912T170536',
      u'wallet_scan_progress':None,
      u'client_version':u'0.4.14'
   }
}

I haven't seen any additional output at all yet; haven't read the python completely either to see if that is expected. Maybe I also need to run a command to "unlock" my wallet first?

Offline Riverhead

Got it working. I had to download the files directly from your link individually. I was doing git clone from the "code" tab which I thought would be the same but clearly is not :) .

Offline Riverhead


Are you on the develop branch of bitshares_toolkit?

update: Probably something with the client config. The error is it thinks "item" is an integer and not an array. Since it just got assigned on the previous line my guess is asset_array is empty.
« Last Edit: September 12, 2014, 04:49:34 pm by Riverhead »

Offline bytemaster

Getting below. Ideas?

Code: [Select]
Init price:  0.038557
Init price:  25.935917
{u'id': 0, u'result': [[u'test.riverhead', [[0, 500000000], [22, 2000000]]]]}
Traceback (most recent call last):
  File "main.py", line 107, in <module>
    init_usd_balance = client.get_balance("USD")
  File "/home/james/github/bitshares_toolkit/programs/market_maker/btsx.py", line 62, in get_balance
    if item[0] == asset:
TypeError: 'int' object has no attribute '__getitem__'

Are you on the develop branch of bitshares_toolkit?
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline Riverhead

Getting below. Ideas?

Code: [Select]
Init price:  0.038557
Init price:  25.935917
{u'id': 0, u'result': [[u'test.riverhead', [[0, 500000000], [22, 2000000]]]]}
Traceback (most recent call last):
  File "main.py", line 107, in <module>
    init_usd_balance = client.get_balance("USD")
  File "/home/james/github/bitshares_toolkit/programs/market_maker/btsx.py", line 62, in get_balance
    if item[0] == asset:
TypeError: 'int' object has no attribute '__getitem__'
« Last Edit: September 12, 2014, 04:01:15 pm by Riverhead »

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Checkout the config.json file in your BitShares data folder (%APPDATA/Roaming -- or so)
in there you can define the user name and the password ..

you can also add --rpcuser X and --rpcpassword X as parameter when launching bitshares .. (checkout "--help")

Offline robrigo


2) I modified main.py in the market_maker script to replace the account_name with my market maker. So that specifies the account to pull funds from. What is USER / PASS corresponding to then? Perhaps a registered account in my wallet as well as the wallet password?

The rpc connection specified in the client's config.json

Doh... that makes perfect sense. Thanks for the info!

Offline Riverhead


2) I modified main.py in the market_maker script to replace the account_name with my market maker. So that specifies the account to pull funds from. What is USER / PASS corresponding to then? Perhaps a registered account in my wallet as well as the wallet password?

The rpc connection specified in the client's config.json

I created a new sub account and imported the privkey into a new wallet running on a different data-dir just to keep things isolated. Don't want a script bug selling my stash :)
« Last Edit: September 12, 2014, 03:10:31 pm by Riverhead »

Offline robrigo

I will be making it significantly easier to user today

robrigo: make an account, fund it, and replace "arbiteur" with your bot's account name

Great, looking forward to your updates. So to clarify:

1) So I should follow this additional step when making bitshares_toolkit to get the release version?

Code: [Select]
# OSX users only!
export CMAKE_PREFIX_PATH=~/Qt/5.3/

cmake -DCMAKE_BUILD_TYPE=Release .
make

2) I modified main.py in the market_maker script to replace the account_name with my market maker. So that specifies the account to pull funds from. What is USER / PASS corresponding to then? Perhaps a registered account in my wallet as well as the wallet password?

Thanks for the quick answers guys!

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I will be making it significantly easier to user today
Now I am expecting a GUI for the bot :-)   8) 8)

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
@robrigo: you realize that the "bitshares_toolkit" is for the testnet .. do you?
When compiling for the 'real' btsx network you need to do almost the same steps on the dacsunlimited/bitshares repo at github

you need to compile the "core" from:
http://wiki.bitshares.org/index.php/BuildInstructionsBitSharesX

//edit: seems I was mistaken .. sorry

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
I will be making it significantly easier to user today

robrigo: make an account, fund it, and replace "arbiteur" with your bot's account name
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 robrigo

I haven't run the CLI version yet but I assume this requires the CLI version? Just wondering I tried to get it to work but keep getting connection refused:

Code: [Select]
Initializing with URL:  http://robrigo-market-maker:************@localhost:8000/rpc
Init price:  0.039835
Init price:  25.103530
Traceback (most recent call last):
  File "main.py", line 107, in <module>
    init_usd_balance = client.get_balance("USD")
  File "/Users/rob/Documents/repos/bitshares_toolkit/programs/market_maker/btsx.py", line 57, in get_balance
    response = self.request("wallet_account_balance", [self.account_name, asset])
  File "/Users/rob/Documents/repos/bitshares_toolkit/programs/market_maker/btsx.py", line 29, in request
    response = requests.post(self.url, data=json.dumps(payload), headers=headers)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 92, in post
    return request('post', url, data=data, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 48, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 451, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 557, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 407, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(61, 'Connection refused'))

So I assume I would need to build / run the bitshares_toolikit? If so, is there any danger of building the client when I already have the GUI installed (i.e. will it modify my current data directory?).

Edit: just remember reading somewhere I can pass an argument to make a 2nd data directory. So that should do the trick!

Thanks! I have been meaning to dig into running a delegate but my less interesting full time job comes first.

Can we have an instruction manual for how you got it to work?

I will certainly publish anything useful I can find... hoping to look into this more tonight after I finish up some more work for my employer.

You probably have the wrong port number.... make sure the port matches the port you passed to the bitshares_client via --httpport

Thanks for the response bytemaster. I was using 8000 for the port but the problem was with the fact that I had not built bitshares_toolkit yet!

So I just built the toolkit, is there some place in the technical wiki I can see all the flags that can be passed to the run command? Currently I am trying to figure out how to make my CLI instance and GUI instance "share" the same data directory... as the master branch of bitshares_toolkit created a new data directory called "BitShares XTS-Test23" to use. If I specify the directory I am using with the 0.4.14 OS X binary I get an issue with the database version:

Code: [Select]
(lldb) run --server --data-dir=/Users/rob/Library/Application\ Support/BitShares\ X/
Process 34216 launched: './bitshares_client' (x86_64)
Loading blockchain from: /Users/rob/Library/Application Support/BitShares X/chain
Loading config from file: /Users/rob/Library/Application Support/BitShares X/config.json
------------ error --------------
30012 new_database_version: new database version

    {"database_version":136,"133":133}
    th_a  chain_database.cpp:258 open_database

    {"data_dir":"/Users/rob/Library/Application Support/BitShares X/chain"}
    th_a  chain_database.cpp:302 open_database

    {"data_dir":"/Users/rob/Library/Application Support/BitShares X/chain"}
    th_a  chain_database.cpp:1094 open

    {"data_dir":"/Users/rob/Library/Application Support/BitShares X/"}
    th_a  client.cpp:1689 open
Process 34216 exited with status = 0 (0x00000000)

I'm going to guess this could probably be fixed by changing some of the config params? Some other questions:

1) Should rpc_username / rpc_password flags match the 'arbiteur' info in the market maker script? Or an account in my wallet?

2) Is it possible to share a data directory between running the latest master branch as CLI / running the GUI or should I keep these separate?

Sorry if my questions seem simple; first time actually diving into this (although I have been wanting to for weeks)!

Offline GaltReport

File "main.py", line 5
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax



what is this?I'm using Ubuntu 14

I suspect you may have downloaded it wrong.  Looks like you have an html version.

Offline bytemaster

I haven't run the CLI version yet but I assume this requires the CLI version? Just wondering I tried to get it to work but keep getting connection refused:

Code: [Select]
Initializing with URL:  http://robrigo-market-maker:************@localhost:8000/rpc
Init price:  0.039835
Init price:  25.103530
Traceback (most recent call last):
  File "main.py", line 107, in <module>
    init_usd_balance = client.get_balance("USD")
  File "/Users/rob/Documents/repos/bitshares_toolkit/programs/market_maker/btsx.py", line 57, in get_balance
    response = self.request("wallet_account_balance", [self.account_name, asset])
  File "/Users/rob/Documents/repos/bitshares_toolkit/programs/market_maker/btsx.py", line 29, in request
    response = requests.post(self.url, data=json.dumps(payload), headers=headers)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 92, in post
    return request('post', url, data=data, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 48, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 451, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 557, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 407, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(61, 'Connection refused'))

So I assume I would need to build / run the bitshares_toolikit? If so, is there any danger of building the client when I already have the GUI installed (i.e. will it modify my current data directory?).

Edit: just remember reading somewhere I can pass an argument to make a 2nd data directory. So that should do the trick!

Thanks! I have been meaning to dig into running a delegate but my less interesting full time job comes first.

Can we have an instruction manual for how you got it to work?

I will certainly publish anything useful I can find... hoping to look into this more tonight after I finish up some more work for my employer.

You probably have the wrong port number.... make sure the port matches the port you passed to the bitshares_client via --httpport   
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline tonyk

  • Hero Member
  • *****
  • Posts: 3308
    • View Profile
We have produced a python script that can be used by anyone who wants to help make the BitUSD market and are looking for developers to help make it better!

https://github.com/BitShares/bitshares_toolkit/tree/develop/programs/market_maker

It is a tad crude right now, but we have plans to make this kind of script configurable for anyone who wants to perform this function. 

The rules are simple:
1) Buy BitUSD cheap (a few percent discount)
2) Sell BitUSD at the median price feed (or the latest feed from BTER) which ever is higher (in dollars per BTSX)
3) Adjust orders anytime they deviate from what the new orders would be by more than some tolerance.

Under this plan no *NEW* bitUSD will be created until the peg is hit *AND* everyone buying BitUSD can expect liquidity within just a few percent.   Meanwhile profits can be made every time someone switches sides of the market.

We are providing the script for others so that we can increase liquidity and decrease the spread (as our bots compete against each other ;) )

Users can now purchase BitUSD with confidence that they can sell it when they need to.   

Usage:
Code: [Select]
python main.py USER PASS PORT REAL_NETWORK
Example:
Code: [Select]
  python main.py user pass 8000 true
You can tweak the parameters by editing:
  main.py

Code: [Select]
SPREAD_PERCENT = 0.05  # 5%
TOLERANCE = 0.01 # should be less than SPREAD_PERCENT / 2, the closer the tolerance the more often orders are canceled/updated

MIN_USD_BALANCE = 10  #make sure you retain enough USD to pay fees to update your orders
MIN_BTSX_BALANCE = 100  # make sure you retain enough BTSX to pay fees to update your orders
MIN_USD_ORDER_SIZE = 2  # prevent dust orders
MIN_BTSX_ORDER_SIZE = 100  # minimum order size to prevent dust

MEDIAN_EDGE_MULTIPLE = 1.001 # how far in front of the median price feed do you want to sell.

Excellent. I think I will use this.

Do you have a list of features which need to be developed to extend this? What sort of improvements are possible?

I think I will try to run several artificial intelligence algos with it. The bad thing is I have never been in touch with  python . It should be rather easy to call is from C++ or Java ,right?
I have  not written a single line of code for more than 7 years also...

[EDIT] reading your own posts is a bitch... This bot already has trading logic in it, I will have to disable or change it for my needs...Stupid me...
« Last Edit: September 12, 2014, 04:32:45 pm by tonyk »
Lack of arbitrage is the problem, isn't it. And this 'should' solves it.

Offline robrigo

I haven't run the CLI version yet but I assume this requires the CLI version? Just wondering I tried to get it to work but keep getting connection refused:

Code: [Select]
Initializing with URL:  http://robrigo-market-maker:************@localhost:8000/rpc
Init price:  0.039835
Init price:  25.103530
Traceback (most recent call last):
  File "main.py", line 107, in <module>
    init_usd_balance = client.get_balance("USD")
  File "/Users/rob/Documents/repos/bitshares_toolkit/programs/market_maker/btsx.py", line 57, in get_balance
    response = self.request("wallet_account_balance", [self.account_name, asset])
  File "/Users/rob/Documents/repos/bitshares_toolkit/programs/market_maker/btsx.py", line 29, in request
    response = requests.post(self.url, data=json.dumps(payload), headers=headers)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 92, in post
    return request('post', url, data=data, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 48, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 451, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 557, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 407, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(61, 'Connection refused'))

So I assume I would need to build / run the bitshares_toolikit? If so, is there any danger of building the client when I already have the GUI installed (i.e. will it modify my current data directory?).

Edit: just remember reading somewhere I can pass an argument to make a 2nd data directory. So that should do the trick!

Thanks! I have been meaning to dig into running a delegate but my less interesting full time job comes first.

Can we have an instruction manual for how you got it to work?

I will certainly publish anything useful I can find... hoping to look into this more tonight after I finish up some more work for my employer.

Offline luckybit

  • Hero Member
  • *****
  • Posts: 2921
    • View Profile
  • BitShares: Luckybit
I haven't run the CLI version yet but I assume this requires the CLI version? Just wondering I tried to get it to work but keep getting connection refused:

Code: [Select]
Initializing with URL:  http://robrigo-market-maker:************@localhost:8000/rpc
Init price:  0.039835
Init price:  25.103530
Traceback (most recent call last):
  File "main.py", line 107, in <module>
    init_usd_balance = client.get_balance("USD")
  File "/Users/rob/Documents/repos/bitshares_toolkit/programs/market_maker/btsx.py", line 57, in get_balance
    response = self.request("wallet_account_balance", [self.account_name, asset])
  File "/Users/rob/Documents/repos/bitshares_toolkit/programs/market_maker/btsx.py", line 29, in request
    response = requests.post(self.url, data=json.dumps(payload), headers=headers)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 92, in post
    return request('post', url, data=data, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 48, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 451, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 557, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 407, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(61, 'Connection refused'))

So I assume I would need to build / run the bitshares_toolikit? If so, is there any danger of building the client when I already have the GUI installed (i.e. will it modify my current data directory?).

Edit: just remember reading somewhere I can pass an argument to make a 2nd data directory. So that should do the trick!

Thanks! I have been meaning to dig into running a delegate but my less interesting full time job comes first.

Can we have an instruction manual for how you got it to work?
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline luckybit

  • Hero Member
  • *****
  • Posts: 2921
    • View Profile
  • BitShares: Luckybit
We have produced a python script that can be used by anyone who wants to help make the BitUSD market and are looking for developers to help make it better!

https://github.com/BitShares/bitshares_toolkit/tree/develop/programs/market_maker

It is a tad crude right now, but we have plans to make this kind of script configurable for anyone who wants to perform this function. 

The rules are simple:
1) Buy BitUSD cheap (a few percent discount)
2) Sell BitUSD at the median price feed (or the latest feed from BTER) which ever is higher (in dollars per BTSX)
3) Adjust orders anytime they deviate from what the new orders would be by more than some tolerance.

Under this plan no *NEW* bitUSD will be created until the peg is hit *AND* everyone buying BitUSD can expect liquidity within just a few percent.   Meanwhile profits can be made every time someone switches sides of the market.

We are providing the script for others so that we can increase liquidity and decrease the spread (as our bots compete against each other ;) )

Users can now purchase BitUSD with confidence that they can sell it when they need to.   

Usage:
Code: [Select]
python main.py USER PASS PORT REAL_NETWORK
Example:
Code: [Select]
  python main.py user pass 8000 true
You can tweak the parameters by editing:
  main.py

Code: [Select]
SPREAD_PERCENT = 0.05  # 5%
TOLERANCE = 0.01 # should be less than SPREAD_PERCENT / 2, the closer the tolerance the more often orders are canceled/updated

MIN_USD_BALANCE = 10  #make sure you retain enough USD to pay fees to update your orders
MIN_BTSX_BALANCE = 100  # make sure you retain enough BTSX to pay fees to update your orders
MIN_USD_ORDER_SIZE = 2  # prevent dust orders
MIN_BTSX_ORDER_SIZE = 100  # minimum order size to prevent dust

MEDIAN_EDGE_MULTIPLE = 1.001 # how far in front of the median price feed do you want to sell.

Excellent. I think I will use this.

Do you have a list of features which need to be developed to extend this? What sort of improvements are possible?
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline robrigo

I haven't run the CLI version yet but I assume this requires the CLI version? Just wondering I tried to get it to work but keep getting connection refused:

Code: [Select]
Initializing with URL:  http://robrigo-market-maker:************@localhost:8000/rpc
Init price:  0.039835
Init price:  25.103530
Traceback (most recent call last):
  File "main.py", line 107, in <module>
    init_usd_balance = client.get_balance("USD")
  File "/Users/rob/Documents/repos/bitshares_toolkit/programs/market_maker/btsx.py", line 57, in get_balance
    response = self.request("wallet_account_balance", [self.account_name, asset])
  File "/Users/rob/Documents/repos/bitshares_toolkit/programs/market_maker/btsx.py", line 29, in request
    response = requests.post(self.url, data=json.dumps(payload), headers=headers)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 92, in post
    return request('post', url, data=data, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 48, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 451, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 557, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 407, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(61, 'Connection refused'))

So I assume I would need to build / run the bitshares_toolikit? If so, is there any danger of building the client when I already have the GUI installed (i.e. will it modify my current data directory?).

Edit: just remember reading somewhere I can pass an argument to make a 2nd data directory. So that should do the trick!

Thanks! I have been meaning to dig into running a delegate but my less interesting full time job comes first.
« Last Edit: September 11, 2014, 09:25:18 pm by robrigo »

Offline betax

  • Hero Member
  • *****
  • Posts: 808
    • View Profile
 +5% sleep or not sleep that is the question :)
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline tonyk

  • Hero Member
  • *****
  • Posts: 3308
    • View Profile
Wow... You guys must not sleep?

I am pretty sure somebody has succeeded at cloning them... before I can do it, that is...
Lack of arbitrage is the problem, isn't it. And this 'should' solves it.

Offline Method-X

  • Hero Member
  • *****
  • Posts: 1131
  • VIRAL
    • View Profile
    • Learn to code
  • BitShares: methodx
Wow... You guys must not sleep?

Xeldal

  • Guest
 +5% Outstanding!
I guess I'll put off sleep for another day.

Offline oldman

  • Hero Member
  • *****
  • Posts: 556
    • View Profile
Would be great if these types of tools could be implemented in the GUI as wizards/robots.

I am not nearly sophisticated enough to compile/run/interface with a script.

However, I can:

- Open the "AutoTrade" tab

- Agree with a disclaimer

- Select the 'bitUSD Market Maker' bot

- Enter the amount of BTSX/bitUSD I want to trade

- Hit the 'Go' button

My suggestion would be for the devs to add a basic algo toolkit to the GUI that automates basic market operations and can be used on any asset class.

Such a feature set would bring a flood of liquidity *and* further the Bitshares competitive advantage over other platforms.

Already on the drawing board... this script is just a proof-of-concept while we work to make it easier for small players.

Damn, you folks never cease to impress!  +5%

Now, who said unsophisticated players are small players? ;D

Offline tonyk

  • Hero Member
  • *****
  • Posts: 3308
    • View Profile
Where did I loose track with those fast developments?

Code: [Select]
MIN_USD_ORDER_SIZE = 2  # prevent dust orders
Isn't min order 100 BTSX...or is it so just for short orders?

hmm, seeing my own orders I have one for less then 2 BTSX ???

Anybody has any idea what '100 BTSX min' pertains to and if this is still valid at all?

 
« Last Edit: September 11, 2014, 09:05:00 pm by tonyk »
Lack of arbitrage is the problem, isn't it. And this 'should' solves it.


Offline bytemaster

Would be great if these types of tools could be implemented in the GUI as wizards/robots.

I am not nearly sophisticated enough to compile/run/interface with a script.

However, I can:

- Open the "AutoTrade" tab

- Agree with a disclaimer

- Select the 'bitUSD Market Maker' bot

- Enter the amount of BTSX/bitUSD I want to trade

- Hit the 'Go' button

My suggestion would be for the devs to add a basic algo toolkit to the GUI that automates basic market operations and can be used on any asset class.

Such a feature set would bring a flood of liquidity *and* further the Bitshares competitive advantage over other platforms.

Already on the drawing board... this script is just a proof-of-concept while we work to make it easier for small players.
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline oldman

  • Hero Member
  • *****
  • Posts: 556
    • View Profile
Would be great if these types of tools could be implemented in the GUI as wizards/robots.

I am not nearly sophisticated enough to compile/run/interface with a script.

However, I can:

- Open the "AutoTrade" tab

- Agree with a disclaimer

- Select the 'bitUSD Market Maker' bot

- Enter the amount of BTSX/bitUSD I want to trade

- Hit the 'Go' button

My suggestion would be for the devs to add a basic algo toolkit to the GUI that automates basic market operations and can be used on any asset class.

Such a feature set would bring a flood of liquidity *and* further the Bitshares competitive advantage over other platforms.

Offline GaltReport


Offline bytemaster

from my understanding you just run it like this

python main.py rpcuser rpcpass rpcport 1

gonna try this out tomorrow ..

I updated the OP with docs on how to use it :)
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
from my understanding you just run it like this

python main.py rpcuser rpcpass rpcport 1

gonna try this out tomorrow ..

you will need a local account "local-market-maker"

Offline Shentist

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 1601
    • View Profile
    • metaexchange
  • BitShares: shentist
would it possible if someone can set up a demo bts wallet with this bot to see how it is function?

i would love to run it my technical knowledge is limited.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
wow .. thats a free arbitrage bot .. am I right?

you guys rock!
« Last Edit: September 11, 2014, 08:40:03 pm by xeroc »

Offline bytemaster

We have produced a python script that can be used by anyone who wants to help make the BitUSD market and are looking for developers to help make it better!

https://github.com/BitShares/bitshares_toolkit/tree/develop/programs/market_maker

It is a tad crude right now, but we have plans to make this kind of script configurable for anyone who wants to perform this function. 

The rules are simple:
1) Buy BitUSD cheap (a few percent discount)
2) Sell BitUSD at the median price feed (or the latest feed from BTER) which ever is higher (in dollars per BTSX)
3) Adjust orders anytime they deviate from what the new orders would be by more than some tolerance.

Under this plan no *NEW* bitUSD will be created until the peg is hit *AND* everyone buying BitUSD can expect liquidity within just a few percent.   Meanwhile profits can be made every time someone switches sides of the market.

We are providing the script for others so that we can increase liquidity and decrease the spread (as our bots compete against each other ;) )

Users can now purchase BitUSD with confidence that they can sell it when they need to.   

Usage:
Code: [Select]
python main.py USER PASS PORT REAL_NETWORK
Example:
Code: [Select]
  python main.py user pass 8000 true
You can tweak the parameters by editing:
  main.py

Code: [Select]
SPREAD_PERCENT = 0.05  # 5%
TOLERANCE = 0.01 # should be less than SPREAD_PERCENT / 2, the closer the tolerance the more often orders are canceled/updated

MIN_USD_BALANCE = 10  #make sure you retain enough USD to pay fees to update your orders
MIN_BTSX_BALANCE = 100  # make sure you retain enough BTSX to pay fees to update your orders
MIN_USD_ORDER_SIZE = 2  # prevent dust orders
MIN_BTSX_ORDER_SIZE = 100  # minimum order size to prevent dust

MEDIAN_EDGE_MULTIPLE = 1.001 # how far in front of the median price feed do you want to sell.
« Last Edit: September 11, 2014, 08:48:32 pm by bytemaster »
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.