[StakeMachine] Trading infrastructure and simple market making bot for Bitshares | OpenSource Bot for BitShares

in #bitshares8 years ago (edited)

I am proud to now publicly announce the first release of StakeMachine.

What is it?

It is a Python tool that offers:

Simple Market Making

A simple market making strategy (i.e. providing liquidity) works as follows:

  1. Get the last price for your market
  2. Place a buy order at last price * 95%
  3. Place a sell order at last price * 105%
  4. Wait for any of the two orders to get filled
  5. Cancel the other order
  6. Go to 1.

This strategy is very simple and tries to makes a profit from the spread. The more volatile a market is, the more profit it will (probably) make you.

Usage

Requirements

  • python 3

Installation

git clone https://github.com/xeroc/stakemachine
cd stakemachine
python3 setup.py install --user -r requirements.txt

Configuration

There is an example YAML formatted configuration file called config-example.yml.
The general configuration looks like this

witness_url: "wss://bitshares.openledger.info/ws"
prefix: "BTS"
safe_mode: True
account: "<accountname>"
wif: "<active-private-key-for-account>"
market_separator: ":"

bots:
    MakerWall:
        module: "stakemachine.strategies.maker"
        bot: "MakerSellBuyWalls"
        markets:
            - "USD:BTS"
        target_price: "last"
        target_price_offset_percentage: 1
        spread_percentage: 5
        volume_percentage: 50
        symmetric_sides: True
        only_buy: False
        only_sell: False

Advanced Settings

As you can see, the idea is to

  • Allow different strategies to be added easily
  • Different parameters for different bots
  • Multiple bots in parallel
bots:
    MakerWallBitAssets:
        module: "stakemachine.strategies.maker"
        bot: "MakerSellBuyWalls"
        markets:
            - "USD:BTS"
            - "GOLD:BTS"
        target_price: "last"
        target_price_offset_percentage: 1
        spread_percentage: 5
        volume_percentage: 50
        symmetric_sides: True
        only_buy: False
        only_sell: False

    MakerWallBTCBridge5:
        module: "stakemachine.strategies.maker"
        bot: "MakerSellBuyWalls"
        markets:
            - "OPEN.BTC:BTC"
            - "OPEN.BTC:TRADE.BTC"
            - "TRADE.BTC:BTC"
        target_price: 1.0
        target_price_offset_percentage: 0
        spread_percentage: 5
        volume_percentage: 50
        symmetric_sides: True
        only_buy: False
        only_sell: False

    MakerWallBTCBridge10:
        module: "stakemachine.strategies.maker"
        bot: "MakerSellBuyWalls"
        markets:
            - "OPEN.BTC:BTC"
            - "OPEN.BTC:TRADE.BTC"
            - "TRADE.BTC:BTC"
        target_price: 1.0
        target_price_offset_percentage: 0
        spread_percentage: 10
        volume_percentage: 50
        symmetric_sides: True
        only_buy: False
        only_sell: False

Running the bot

Once the configuration is done, you can run your bot (with safe_mode on) using

stakemachine -c config.yml once

or

stakemachine -c config.yml run

Roadmap

Extend the python-graphene library to allow

  • Core Exchange Rate tracking
  • Refilling of Fee Pools
  • More trading strategies (heuristic, EMA-crossings, etc.)
Sort:  

How can i check it on the testnet?

change:

  1. witness_url: "wss://bitshares.openledger.info/ws" to a testnet witness ("ws://testnet.bitshares.eu/ws" for example),
  2. "BTS" to "TEST"
  3. "markets:" to markets on the testnet

So, the liquidity-providing strategy is other software that base on your library?
As i understand it need cli_wallet and your not !?

It's a strategy that uses @xeroc 's bot infrastructure combined with deployment/automatic registration scripts.
In StakeMachine the strategy is updated to work without cli_wallet, those changes (and more) will be implemented in the next release of LiqBot.

This is great!! Everybody can now use their idling funds to add some liqudity in the markets and earn a profit!! Great work Xeroc!

I wouldn't claim this makes a profit for sure .. but the strategy is easy enough for people to understand it makes sense and may make a profit

Hello! Prompt as it is possible to use a boat for trade at the internal exchange steemit!? What changes need to be entered into a code? Yours faithfully Irina =)

Sorry that this question may not directly related to stakemachine. Can python-graphene be run on Windows with python3 installed?

Technically it should also work on Windows, however, I don't have a windows machine around so I cannot check it.

Hey @xeroc,

Are you planning on continuing development of the stakemachine?

Thanks,
CM.

I have already started working on migrating it over to pybitshares .. just notfinished yet ..
might take quite some time until this can be released .. much stuff going on right now

Cool, looking forwards to future releases :)

Perhaps consider a worker proposal? I'd vote for it! :D

Hey @xeroc ! I’ve recently been trying to get stakemachine working but am having some difficulty. I know you mentioned you were making some changes with it... are these changes still in progress? I’ve used your stakemachine pdf you posted a couple months ago to copy the walls config but still can’t get the walls to work. I posted on GitHub. Anyway, if you have any additional guidance or documentation that could help I would greatly appreciate it. I’m new to both Ubuntu and python but willing to put in some work. Thanks

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 59139.97
ETH 2676.50
USDT 1.00
SBD 2.44