BitShares Forum

Main => General Discussion => Topic started by: bytemaster on September 11, 2014, 08:32:08 pm

Title: BitUSD Market Maker Live
Post by: bytemaster on September 11, 2014, 08:32:08 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: xeroc on September 11, 2014, 08:34:02 pm
wow .. thats a free arbitrage bot .. am I right?

you guys rock!
Title: Re: BitUSD Market Maker Live
Post by: Shentist on September 11, 2014, 08:42:14 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: xeroc on September 11, 2014, 08:48:38 pm
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"
Title: Re: BitUSD Market Maker Live
Post by: bytemaster on September 11, 2014, 08:49:42 pm
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 :)
Title: Re: BitUSD Market Maker Live
Post by: GaltReport on September 11, 2014, 08:49:54 pm
Cool!!
Title: Re: BitUSD Market Maker Live
Post by: oldman on September 11, 2014, 08:50:01 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: bytemaster on September 11, 2014, 08:53:32 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: Empirical1.1 on September 11, 2014, 08:57:15 pm
Cool!!

 +5%
Title: Re: BitUSD Market Maker Live
Post by: tonyk on September 11, 2014, 09:03:26 pm
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?

 
Title: Re: BitUSD Market Maker Live
Post by: oldman on September 11, 2014, 09:05:42 pm
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
Title: Re: BitUSD Market Maker Live
Post by: Xeldal on September 11, 2014, 09:07:41 pm
 +5% Outstanding!
I guess I'll put off sleep for another day.
Title: Re: BitUSD Market Maker Live
Post by: Method-X on September 11, 2014, 09:11:24 pm
Wow... You guys must not sleep?
Title: Re: BitUSD Market Maker Live
Post by: tonyk on September 11, 2014, 09:15:11 pm
Wow... You guys must not sleep?

I am pretty sure somebody has succeeded at cloning them... before I can do it, that is...
Title: Re: BitUSD Market Maker Live
Post by: betax on September 11, 2014, 09:18:59 pm
 +5% sleep or not sleep that is the question :)
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 11, 2014, 09:23:24 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: luckybit on September 11, 2014, 09:35:45 pm
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?
Title: Re: BitUSD Market Maker Live
Post by: luckybit on September 11, 2014, 09:36:33 pm
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?
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 11, 2014, 09:39:02 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: tonyk on September 11, 2014, 09:44:11 pm
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...
Title: Re: BitUSD Market Maker Live
Post by: bytemaster on September 12, 2014, 02:13:26 am
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   
Title: Re: BitUSD Market Maker Live
Post by: GaltReport on September 12, 2014, 12:33:42 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 12, 2014, 02:35:35 pm
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)!
Title: Re: BitUSD Market Maker Live
Post by: toast on September 12, 2014, 02:41:08 pm
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
Title: Re: BitUSD Market Maker Live
Post by: xeroc on September 12, 2014, 02:43:15 pm
@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
Title: Re: BitUSD Market Maker Live
Post by: xeroc on September 12, 2014, 02:44:24 pm
I will be making it significantly easier to user today
Now I am expecting a GUI for the bot :-)   8) 8)
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 12, 2014, 03:04:55 pm
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!
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 12, 2014, 03:08:50 pm

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 :)
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 12, 2014, 03:10:11 pm

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!
Title: Re: BitUSD Market Maker Live
Post by: xeroc on September 12, 2014, 03:10:19 pm
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")
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 12, 2014, 03:57:11 pm
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__'
Title: Re: BitUSD Market Maker Live
Post by: bytemaster on September 12, 2014, 04:04:14 pm
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?
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 12, 2014, 04:09:07 pm

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.
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 12, 2014, 05:21:11 pm
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 :) .
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 12, 2014, 05:24:08 pm
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?
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 12, 2014, 05:31:17 pm
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
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 12, 2014, 05:52:01 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: toast on September 12, 2014, 05:56:56 pm
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...
Title: Re: BitUSD Market Maker Live
Post by: emailtooaj on September 12, 2014, 10:20:54 pm
watching  :) +5%
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 13, 2014, 09:29:00 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: xeroc on September 14, 2014, 10:04:36 am
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 :)
Title: Re: BitUSD Market Maker Live
Post by: cass on September 14, 2014, 10:47:15 am
I will be making it significantly easier to user today
Now I am expecting a GUI for the bot :-)   8) 8)

 +5% 8)
Title: Re: BitUSD Market Maker Live
Post by: 38PTSWarrior on September 14, 2014, 11:20:55 am
I'm coming!
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 14, 2014, 11:31:16 am
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.
Title: Re: BitUSD Market Maker Live
Post by: betax on September 14, 2014, 11:40:59 am
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!).
Title: Re: BitUSD Market Maker Live
Post by: 38PTSWarrior on September 14, 2014, 11:56:37 am
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.
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 14, 2014, 11:57:47 am
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
Title: Re: BitUSD Market Maker Live
Post by: 38PTSWarrior on September 14, 2014, 12:04:32 pm
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 =)
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 14, 2014, 12:11:27 pm
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
Title: Re: BitUSD Market Maker Live
Post by: 38PTSWarrior on September 14, 2014, 12:22:19 pm
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?
Title: Re: BitUSD Market Maker Live
Post by: robrigo on September 14, 2014, 12:24:19 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: 38PTSWarrior on September 14, 2014, 12:25:42 pm
OK, I will go there, but I meant the chat from the website

Title: Re: BitUSD Market Maker Live
Post by: G1ng3rBr34dM4n on September 14, 2014, 07:32:31 pm
Working on getting a market maker bot set up as well.

Big thanks to robrigo for the help so far!
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 15, 2014, 12:58:45 pm
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
Title: Re: BitUSD Market Maker Live
Post by: abit on September 15, 2014, 02:26:05 pm
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
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 15, 2014, 02:35:29 pm
It should match the def line
Title: Re: BitUSD Market Maker Live
Post by: Gentso1 on September 15, 2014, 11:17:26 pm
any progress on the windows version of the bot?
Title: Re: BitUSD Market Maker Live
Post by: xeroc on September 16, 2014, 06:09:54 am
you just need a python interpreter:
windows:  http://www.activestate.com/activepython/downloads

but don't expect a fancy GUI .. yet (toast?) ;-)
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 16, 2014, 03:48:37 pm
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.

Title: Re: BitUSD Market Maker Live
Post by: xeroc on September 16, 2014, 04:26:39 pm
... and less buggy than the GUI :)
Title: Re: BitUSD Market Maker Live
Post by: abit on September 16, 2014, 05:19:42 pm
Anyone has any profit generated?
I saw no transaction done with the default config..
Title: Re: BitUSD Market Maker Live
Post by: tonyk on September 16, 2014, 09:23:32 pm
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?

Title: Re: BitUSD Market Maker Live
Post by: maqifrnswa on September 16, 2014, 09:36:00 pm
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
Title: Re: BitUSD Market Maker Live
Post by: tonyk on September 17, 2014, 12:48:47 am
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'



Title: Re: BitUSD Market Maker Live
Post by: abit on September 17, 2014, 03:08:40 am
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)
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 17, 2014, 02:00:32 pm

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
Title: Re: BitUSD Market Maker Live
Post by: xeroc on September 17, 2014, 02:04:26 pm
awesome .. I remember something like this from mtgox .. cant remember the name though :)
will try for sure .. for the fun .. 10$ ;-)
Title: Re: BitUSD Market Maker Live
Post by: toast on September 17, 2014, 02:52:24 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 17, 2014, 02:55:32 pm
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
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on September 17, 2014, 05:24:14 pm
Fixed a bug in btsx.py (cancel_all_orders). Can I push the fix up to freetradebots/btsx_bots?
Title: Re: BitUSD Market Maker Live
Post by: toast on September 17, 2014, 05:27:26 pm
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
Title: Re: BitUSD Market Maker Live
Post by: maqifrnswa on September 17, 2014, 05:47:41 pm
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
Title: Re: BitUSD Market Maker Live
Post by: tonyk on September 17, 2014, 06:58:02 pm
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.
Title: Re: BitUSD Market Maker Live
Post by: xeroc on September 17, 2014, 07:10:59 pm
@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
Title: Re: BitUSD Market Maker Live
Post by: tonyk on September 17, 2014, 08:26:55 pm
Finally.

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

Thank you all for the help!

Title: Re: BitUSD Market Maker Live
Post by: maqifrnswa on September 17, 2014, 08:36:52 pm
@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.
Title: Re: BitUSD Market Maker Live
Post by: bitandrew on October 17, 2014, 12:40:55 pm
the script is deleted? I can not find it with https://github.com/BitShares/bitshares_toolkit/tree/develop/programs/market_maker
thank you!
Title: Re: BitUSD Market Maker Live
Post by: Riverhead on October 17, 2014, 01:11:29 pm
Try this. It's the submodule that was in there:


https://github.com/freetradebots/btsx_bots

Title: Re: BitUSD Market Maker Live
Post by: xeroc on October 17, 2014, 01:31:12 pm
also check out riverheads fork and maybe my fork if you are interested

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