Author Topic: Basic market maker bot for bter BTC/bitUSD available  (Read 7687 times)

0 Members and 1 Guest are viewing this topic.

Offline Riverhead


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.

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil

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. :)
Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."

Offline Riverhead


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.



Offline fluxer555

  • Hero Member
  • *****
  • Posts: 749
    • View Profile
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

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
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.

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil
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

Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."

Offline Helikopterben

  • Sr. Member
  • ****
  • Posts: 202
    • View Profile

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
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.

Offline Helikopterben

  • Sr. Member
  • ****
  • Posts: 202
    • View Profile
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.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
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 ..

clout

  • Guest
are there any open source market maker bots for trading in bitUSD/bitAsset?

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil
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

Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."

iHashFury

  • Guest
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


Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
Is anyone still running the bots? There are barely any BitUSD sell orders available on https://bter.com/trade/btc_bitusd.

iHashFury

  • Guest

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil
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

Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."

Offline abelljefrry


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
Need a designer for your project? Hire me! I accept BTS as payment :)

View my BitShares design portfolio here : bit.ly/BitSharesPortfolio

Xeldal

  • Guest

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
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.
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 abelljefrry

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.
Need a designer for your project? Hire me! I accept BTS as payment :)

View my BitShares design portfolio here : bit.ly/BitSharesPortfolio

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
I think the readme is wrong. You need to cd into where main.go lives.
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.

Xeldal

  • Guest
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.
« Last Edit: January 16, 2015, 10:16:49 pm by Xeldal »

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Seems like a syntax error in your config file ... please check

Xeldal

  • Guest
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

Offline clayop

  • Hero Member
  • *****
  • Posts: 2033
    • View Profile
    • Bitshares Korea
  • BitShares: clayop
Bitshares Korea - http://www.bitshares.kr
Vote for me and see Korean Bitshares community grows
delegate-clayop

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
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
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.