BitShares Forum

Main => General Discussion => Topic started by: toast on January 16, 2015, 07:03:38 pm

Title: Basic market maker bot for bter BTC/bitUSD available
Post by: toast on January 16, 2015, 07:03:38 pm
It's still very primitive. You will have to rebalance manually via BTS and I'm sure there are a million edge cases it can't handle.

But hey with just a few BTC we brought the bitUSD/BTC volume up from 2 BTC to 70 BTC.

If traders look at vanity numbers, let's give them vanity numbers!

https://github.com/freetradebots/market_maker
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: xeroc on January 16, 2015, 07:11:37 pm
+5% .. thx
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: clayop on January 16, 2015, 08:25:35 pm
 +5% +5% +5%
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: Xeldal on January 16, 2015, 08:31:42 pm
It was working 4 me before I updated.
I git pull'd market_maker , updated config and now get this error.

Code: [Select]
# go run main.go
panic: invalid character '"' after object key:value pair

goroutine 1 [running]:
main.check(0x7fe592d0bd90, 0xc20801e080)
        /usr/local/sbin/src/github.com/freetradebots/market_maker/main.go:17 +0x50
main.main()
        /usr/local/sbin/src/github.com/freetradebots/market_maker/main.go:27 +0x190

goroutine 2 [runnable]:
runtime.forcegchelper()
        /usr/local/go/src/runtime/proc.go:90
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 3 [runnable]:
runtime.bgsweep()
        /usr/local/go/src/runtime/mgc0.go:82
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 4 [runnable]:
runtime.runfinq()
        /usr/local/go/src/runtime/malloc.go:712
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
exit status 2

I looked through your commits and don't see anything that would cause the error.  IDK
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: xeroc on January 16, 2015, 08:44:54 pm
Seems like a syntax error in your config file ... please check
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: Xeldal on January 16, 2015, 10:05:36 pm
config looks good.

Also in the readme:
Quote
cd $GOPATH/src/github.com/freetradebots/market_maker

My GOPATH and GOROOT are set with
export GOROOT=/usr/local/go
export GOPATH=$PATH:$GOROOT/bin

after go get ...
../market_maker/ ends up in
usr/local/sbin/src/github.com/freetradebots/market_maker/

so the command quoted above doesn't take you anywhere.  directory doesn't exist.

Is this my error in setting GOPATH?  remnants from an earlier version?  or is the readme cd wrong?

I had much trouble getting go to get market_maker in the first place several days ago. the directions on https://golang.org/doc/install were not very helpful for my inexperience.

export PATH=$PATH:/usr/local/go/bin   seemed to do nothing, had to set a custom location with above mentioned GOROOT etc. 

Not sure if this maybe relates to the issues I'm having.

Thanks for any assistance.
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: toast on January 16, 2015, 10:09:47 pm
I think the readme is wrong. You need to cd into where main.go lives.
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: abelljefrry on January 16, 2015, 10:22:21 pm
Getting the same error as Xeldal

Code: [Select]
panic: invalid character '"' after object key:value pair
I recheck my config and everything seems fine. 

Oh btw, can you explain a little bit about the parameters? Are those numbers in percentage or BTC? Pardon my noobness.
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: toast on January 16, 2015, 10:34:43 pm
Getting the same error as Xeldal

Code: [Select]
panic: invalid character '"' after object key:value pair
I recheck my config and everything seems fine. 

Oh btw, can you explain a little bit about the parameters? Are those numbers in percentage or BTC? Pardon my noobness.

the config.example had a missing comma after the BterConfig value.

Spread and tolerance are both percent. MaxOrder is BTC.
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: Xeldal on January 16, 2015, 10:48:24 pm
That fixed it. Thanks.
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: abelljefrry on January 16, 2015, 11:06:44 pm

the config.example had a missing comma after the BterConfig value.

Spread and tolerance are both percent. MaxOrder is BTC.

Fixed. Thanks Toast.

Will pump in some fund to see it in action. :D
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: biophil on January 17, 2015, 12:07:58 am
Toast, have you talked to any other exchanges yet about adding bitAssets? It seems like it would be a huge plus for an exchange to know ahead of time that there will be market-maker bots running.

Sent from my SCH-S720C using Tapatalk 2

Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: iHashFury on January 17, 2015, 03:33:02 pm
 +5%

Thanks Toast.
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: arhag on January 23, 2015, 07:57:36 pm
Is anyone still running the bots? There are barely any BitUSD sell orders available on https://bter.com/trade/btc_bitusd.
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: iHashFury on January 24, 2015, 11:34:00 am
Yes

I have reduced the MaxOrder so it doesn't run out of BitUSD over night.

Over the last week the bot bought back most of the bitcoin I invested in bitshares  :P

Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: biophil on January 24, 2015, 02:54:54 pm
Yes

I have reduced the MaxOrder so it doesn't run out of BitUSD over night.

Over the last week the bot bought back most of the bitcoin I invested in bitshares  :P

Just want to point out the for something like 2 or 3 days straight,  toast's bot was offering the world triangular arbitrage because it was offering very high bitusd prices for BTC. I'm guessing that's why there aren't any more bitUSD on the order books...

Sent from my SCH-S720C using Tapatalk 2

Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: clout on January 24, 2015, 03:36:06 pm
are there any open source market maker bots for trading in bitUSD/bitAsset?
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: xeroc on January 24, 2015, 04:03:53 pm
are there any open source market maker bots for trading in bitUSD/bitAsset?
Take a look at my fork of btsx_bots in my github ... though be warned that except the balancing bot none have been tested yet ..
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: Helikopterben on January 24, 2015, 09:34:02 pm
Maybe someone could create a 100% delegate and fund a bot with a portion of the proceeds.  That way we could more directly compete with nubits.  You wouldn't have to risk your own money and you could help bootstrap these assets on the exchanges and get paid at the same time.  Perhaps you could even optimise this bot to be profitable over time.  As you get more and more capital, you could bootstrap other bitassets on the exchanges.  Maybe 50% of the pay could go to fund the bot and 50% pay kept by the delegate for her work in maintaining the bots.
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: arhag on January 24, 2015, 09:49:43 pm
Maybe someone could create a 100% delegate and fund a bot with a portion of the proceeds.  That way we could more directly compete with nubits.  You wouldn't have to risk your own money and you could help bootstrap these assets on the exchanges and get paid at the same time.  Perhaps you could even optimise this bot to be profitable over time.  As you get more and more capital, you could bootstrap other bitassets on the exchanges.  Maybe 50% of the pay could go to fund the bot and 50% pay kept by the delegate for her work in maintaining the bots.

Rather than repeat what has already been discussed, I will just point to https://bitsharestalk.org/index.php?topic=13334.msg174476#msg174476:
We need market makers who run bots on centralized exchanges. Maybe another opportunity for paid delegate?

Sounds like an opportunity for *anyone who wants to make money*. We don't need to PAY people to make money, and we don't need to support artificial walls which will disappear when we pull the plug but prevent real market makers in the meantime.
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: Helikopterben on January 24, 2015, 10:09:43 pm
Rather than repeat what has already been discussed

Thanks
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: biophil on January 25, 2015, 03:48:39 am
Maybe someone could create a 100% delegate and fund a bot with a portion of the proceeds.  That way we could more directly compete with nubits.  You wouldn't have to risk your own money and you could help bootstrap these assets on the exchanges and get paid at the same time.  Perhaps you could even optimise this bot to be profitable over time.  As you get more and more capital, you could bootstrap other bitassets on the exchanges.  Maybe 50% of the pay could go to fund the bot and 50% pay kept by the delegate for her work in maintaining the bots.

Rather than repeat what has already been discussed, I will just point to https://bitsharestalk.org/index.php?topic=13334.msg174476#msg174476:
We need market makers who run bots on centralized exchanges. Maybe another opportunity for paid delegate?

Sounds like an opportunity for *anyone who wants to make money*. We don't need to PAY people to make money, and we don't need to support artificial walls which will disappear when we pull the plug but prevent real market makers in the meantime.

Sure, except that toast is VASTLY overestimating how much money there is to be made net of exposure to BTC volatility. I quite like the idea of a delegate acting as a market-maker loss-leader.

Sent from my SCH-S720C using Tapatalk 2

Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: arhag on January 25, 2015, 04:59:18 am
Sure, except that toast is VASTLY overestimating how much money there is to be made net of exposure to BTC volatility.

Market makers should just go short on BitBTC to hedge against BTC volatility. Of course they are still exposed to BTS volatility but my guess is that the market makers would have likely been holding BTS anyway if they weren't putting their funds to use for market making.

For those who want to be protected against BTS volatility as well but still do market making (so they only want exposure to BitUSD or other BitFiat), they would have to wait until it is possible to short BitAssets using other BitAssets as collateral, e.g. short BitBTC using BitUSD as collateral.

I really dislike the idea of subsidizing market makers through BTS dilution to make it appear like we have better liquidity than we really do. I think this will all come in time naturally as the client gets better and becomes more usable and user adoption grows.
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: fluxer555 on January 25, 2015, 04:33:40 pm
Sure, except that toast is VASTLY overestimating how much money there is to be made net of exposure to BTC volatility.

Market makers should just go short on BitBTC to hedge against BTC volatility. Of course they are still exposed to BTS volatility but my guess is that the market makers would have likely been holding BTS anyway if they weren't putting their funds to use for market making.

For those who want to be protected against BTS volatility as well but still do market making (so they only want exposure to BitUSD or other BitFiat), they would have to wait until it is possible to short BitAssets using other BitAssets as collateral, e.g. short BitBTC using BitUSD as collateral.

I really dislike the idea of subsidizing market makers through BTS dilution to make it appear like we have better liquidity than we really do. I think this will all come in time naturally as the client gets better and becomes more usable and user adoption grows.

+5%

Please, let's not open this pandora's box
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: Riverhead on January 26, 2015, 03:11:35 pm

I run the market maker bot on bter to make money. It provides liquidity but it trades on a spread against bitstamp's BTC price. It has the side effect of also supporting the peg. This isn't false volume in IMHO as even non Bitshares supporters would do this to make money.

Changes I just submitted:

1) config.json now supports new parameters MinBal_Quote, MinOrder, and Base.

2) Logic changed to use all funds in your account up to the MaxOrder parameter with an order no smaller than MinOrder that also does not put the account below MinBal_Quote.

For example if you set MinBal_Quote to 1 and MinOrder to 0.5 and MaxOrder to 5 it would use all the funds in both bitUSD and BTC to submit orders of value 0.5 BTC or greater up to 5 BTC that still leaves 1 BTC of value in both BTC and bitUSD.


Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: biophil on January 26, 2015, 03:35:20 pm

I run the market maker bot on bter to make money. It provides liquidity but it trades on a spread against bitstamp's BTC price. It has the side effect of also supporting the peg. This isn't false volume in IMHO as even non Bitshares supporters would do this to make money.

Changes I just submitted:

1) config.json now supports new parameters MinBal_Quote, MinOrder, and Base.

2) Logic changed to use all funds in your account up to the MaxOrder parameter with an order no smaller than MinOrder that also does not put the account below MinBal_Quote.

For example if you set MinBal_Quote to 1 and MinOrder to 0.5 and MaxOrder to 5 it would use all the funds in both bitUSD and BTC to submit orders of value 0.5 BTC or greater up to 5 BTC that still leaves 1 BTC of value in both BTC and bitUSD.

Questions for you:
1. do you actually make money? I'm running a market maker bot of my own design on the same trading pair and it's actually been a surprisingly good volatility-hedging machine, but I'm certainly not netting any profits in USD.

2. Are you aware that your bot (I assume it was yours; could be wrong) was offering almost $1000 of a 4% arbitrage opportunity yesterday? If I had had the funds in the right places, I could have sold bitUSD on the BTS exchange, sold BTS for BTC on bter, and then bought your cheap bitUSD with the BTC, earning 4% net of fees. This is a PSA more than anything; I just wanted to let you know that you're frequently offering the world significant portions of your surplus. And, if I keep seeing these juicy arbitrage opportunities, I don't think I'll be able to keep myself from writing an arbitrage bot. :)
Title: Re: Basic market maker bot for bter BTC/bitUSD available
Post by: Riverhead on January 26, 2015, 03:44:54 pm

Please, arbitrage away. Exploiting arbitrage when it's available makes you money and pushes the two markets towards parity. I'm not sure if it was my bot or not. Could have been as I'm playing with the code constantly and it may sometimes put up some unpleasant orders lol. I've been running it for a week or so now and am up about 25%. That is most likely due to the recent BTC recovery than any exceptional bot logic though.