Results 1 to 8 of 8

Thread: AMA: I algo trade the Bitshares DEX

  1. #1

    AMA: I algo trade the Bitshares Distributed Exchange

    I have developed a suite of tools for the bitshares distributed exchange (DEX)

    extinctionEVENT.py
    microDEX.py
    metaNODE.py
    latencyTEST.py

    they are all open source and free to use, license:

    Code:
    WTFPL v0 ca. 1765
    
    if any([taxes,licenses]):
        return (tar, feathers)
    you can find these on my github:

    https://github.com/litepresence/extinction-event/EV


    to download the official bitshares ui and learn more about bitshares, go here:

    https://bitshares.org/download





    metaNODE.py

    metaNODE is a client side mesh network tool I developed for interacting with Bitshares Public DEX Nodes in a trustless manner. The tool scans the bitshares network for latest orderbook and account data and then statistically verifies that data vs other nodes in the public network. metaNODE then writes metaNODE.txt (in a race condition proof manner) which contains a dictionary of orderbook and account data. Other apps can then read like a high speed personal API of verified DEX data.

    You can read the metaNODE whitepaper here: https://github.com/litepresence/exti...aster/metaNODE

    extinctionEVENT.py

    extinctionEVENT (EV) is a simple moving average trading tool which splits the market into Bull/Bear state and then trades on different thresholds depending on state. Is capable of producing live moving averages from 5m scale to daily candle scale; all at 5m resolution. EV also includes a backtesting engine for optimizing your algorithm. extinctionEVENT.py gets DEX data from metaNODE.txt. The utilities also import centralized exchange data from cryptocompare.com for visualization, backtesting, and decision making.

    microDEX.py

    microDEX is user interface much like you'd find when trading at a centralized exchange. It has a chart, order books, recent market trades, and authenticated buy/sell/cancel. Like EV gets its DEX data from metaNODE and CEX data from cryptocompare.

    latencyTEST.py

    latencyTEST first reaches out to github and searches for lists of bitshares nodes on user accounts known to keep up on such things. It then takes the lists from each user and makes one huge list; the universe. The nodes in the universe may or may not be active though, so then it attempts to contact each node to verify that it 1) responds 2) is running the correct software 3) its clock is not stale. From the nodes in the known universe it generates a list of available public api websockets and writes a file nodes.txt with that list. It also outputs a nodesmap.png image file. nodes.txt is used later by metaNODE.py to to gather DEX data.

    all combined are about 8000 lines of python;
    all freeware, open source, no fees, no black boxes, no centralized crypto exchange to be hacked, shut down, or ddos'd.
    "stable release" stage of development


    24/7 buy/sell/cancel on the DEX (distributed exchange)
    I've demonstrated months of uninterrupted uptime.

    Code:
    LICENSE:
    
    'litepresence 2018'
    
    def WTFPL_v0_March_1765():
        if any([stamps, licenses, taxation, regulation, fiat, etat]):
            try:
                print('no thank you')
            except:
                return [tar, feathers]
    
    I've been live 9 months trading a moving average cross signal with about 20 day buy/sell frequency and maintaining scalp orders. All orders are updated every 5 minutes. I've had very little downtime and no rogue data from the DEX.

    AMA


    Last edited by presence; 12-15-2018 at 04:08 PM.

    'We endorse the idea of voluntarism; self-responsibility: Family, friends, and churches to solve problems, rather than saying that some monolithic government is going to make you take care of yourself and be a better person. It's a preposterous notion: It never worked, it never will. The government can't make you a better person; it can't make you follow good habits.' - Ron Paul 1988

    Awareness is the Root of Liberation Revolution is Action upon Revelation

    'Resistance and Disobedience in Economic Activity is the Most Moral Human Action Possible' - SEK3

    Flectere si nequeo superos, Acheronta movebo.

    ...the familiar ritual of institutional self-absolution...
    ...for protecting them, by mock trial, from punishment...




  2. Remove this section of ads by registering.
  3. #2
    This is microDEX.py it is a buy/sell/cancel utility with orderbooks and a live chart




    This is latencyTEST.py which creates a list of latency sorted Bitshares public API nodes and lets you know where they are in the world.




    This is from my backtest engine extinctionEVENT.py:

    Last edited by presence; 12-15-2018 at 02:45 PM.

    'We endorse the idea of voluntarism; self-responsibility: Family, friends, and churches to solve problems, rather than saying that some monolithic government is going to make you take care of yourself and be a better person. It's a preposterous notion: It never worked, it never will. The government can't make you a better person; it can't make you follow good habits.' - Ron Paul 1988

    Awareness is the Root of Liberation Revolution is Action upon Revelation

    'Resistance and Disobedience in Economic Activity is the Most Moral Human Action Possible' - SEK3

    Flectere si nequeo superos, Acheronta movebo.

    ...the familiar ritual of institutional self-absolution...
    ...for protecting them, by mock trial, from punishment...


  4. #3



    traditional depth of market chart for Bitshares DEX
    latest DEX trades in pink; their normalized volume sized yellow markers
    you account open orders depth plotted in orange with normalized volume sized yellow markers

    'We endorse the idea of voluntarism; self-responsibility: Family, friends, and churches to solve problems, rather than saying that some monolithic government is going to make you take care of yourself and be a better person. It's a preposterous notion: It never worked, it never will. The government can't make you a better person; it can't make you follow good habits.' - Ron Paul 1988

    Awareness is the Root of Liberation Revolution is Action upon Revelation

    'Resistance and Disobedience in Economic Activity is the Most Moral Human Action Possible' - SEK3

    Flectere si nequeo superos, Acheronta movebo.

    ...the familiar ritual of institutional self-absolution...
    ...for protecting them, by mock trial, from punishment...


  5. #4
    This is pretty.
    In New Zealand:
    The Coastguard is a Charity
    Air Traffic Control is a private company run on user fees
    The DMV is a private non-profit
    Rescue helicopters and ambulances are operated by charities and are plastered with corporate logos
    The agriculture industry has zero subsidies
    5% of the national vote, gets you 5 seats in Parliament
    A tax return has 4 fields
    Business licenses aren't a thing
    Prostitution is legal
    We have a constitutional right to refuse any type of medical care

  6. #5
    Okay, I need to spend more time here. I've hardly ever used Bitshares DEX but that's awesome.
    Last edited by basecommand; 03-27-2019 at 03:12 AM.

  7. #6
    thx for sharing.. i use Bitshares as well. Its one of the blockchains I like and do research on.

    how do you connect to remote BTS nodes? RPC, REST API?

  8. #7
    sorry for losing track of this... I've been in dev mode

    how do you connect to remote BTS nodes? RPC, REST API?
    via websocket

    using python 3 and websocket-client module:

    Code:
    from websocket import create_connection as wss
    from json import dumps as json_dumps
    from json import loads as json_loads
    
    
    import time
    
    
    def public_nodes():
        return [
            'wss://altcap.io/wss',
            'wss://api-ru.bts.blckchnd.com/ws',
            'wss://api.bitshares.bhuz.info/wss',
            'wss://api.bitsharesdex.com/ws',
            'wss://api.bts.ai/ws',
            'wss://api.bts.blckchnd.com/wss',
            'wss://api.bts.mobi/wss',
            'wss://api.bts.network/wss',
            'wss://api.btsgo.net/ws',
            'wss://api.btsxchng.com/wss',
            'wss://api.dex.trading/ws',
        ]
    
    
    def wss_handshake(node):
        global ws
        ws = wss(node, timeout=5)
    
    
    
    
    def wss_query(params):
        query = json_dumps({"method": "call",
                            "params": params,
                            "jsonrpc": "2.0",
                            "id": 1})
        ws.send(query)
        ret = json_loads(ws.recv())
        try:
            return ret['result']  # if there is result key take it
        except:
            return ret
    
    
    def rpc_ticker():
    
    
        ret = wss_query(['database',
                         'get_ticker',
                         ['BTS', 'CNY', True]])
        return ret
    
    
    nodes = public_nodes()
    node = nodes[0]
    
    
    wss_handshake(node)
    ticker = rpc_ticker()

    in practice though... this is distributed exchange and the process can be brittle. I proxy my data through the metaNODE.py script which has many checks and balances against network issues and rogue data.

    'We endorse the idea of voluntarism; self-responsibility: Family, friends, and churches to solve problems, rather than saying that some monolithic government is going to make you take care of yourself and be a better person. It's a preposterous notion: It never worked, it never will. The government can't make you a better person; it can't make you follow good habits.' - Ron Paul 1988

    Awareness is the Root of Liberation Revolution is Action upon Revelation

    'Resistance and Disobedience in Economic Activity is the Most Moral Human Action Possible' - SEK3

    Flectere si nequeo superos, Acheronta movebo.

    ...the familiar ritual of institutional self-absolution...
    ...for protecting them, by mock trial, from punishment...


  9. #8
    latest version of microDEX and its extremely responsive and durable

    github - litepresence/extinction-event/EV



    'We endorse the idea of voluntarism; self-responsibility: Family, friends, and churches to solve problems, rather than saying that some monolithic government is going to make you take care of yourself and be a better person. It's a preposterous notion: It never worked, it never will. The government can't make you a better person; it can't make you follow good habits.' - Ron Paul 1988

    Awareness is the Root of Liberation Revolution is Action upon Revelation

    'Resistance and Disobedience in Economic Activity is the Most Moral Human Action Possible' - SEK3

    Flectere si nequeo superos, Acheronta movebo.

    ...the familiar ritual of institutional self-absolution...
    ...for protecting them, by mock trial, from punishment...




  10. Remove this section of ads by registering.


Similar Threads

  1. Trade altcoin/BTC on the Bitshares DEX with Cryptocompare CEX data
    By presence in forum Bitcoin / Cryptocurrencies
    Replies: 1
    Last Post: 03-12-2018, 10:08 AM
  2. Bitshares hiring CSS/React Front End Dev for UI
    By presence in forum Bitcoin / Cryptocurrencies
    Replies: 1
    Last Post: 03-12-2018, 09:55 AM
  3. Replies: 5
    Last Post: 02-04-2017, 06:18 PM
  4. Any day/algo traders here?
    By brandon in forum Economy & Markets
    Replies: 4
    Last Post: 12-24-2013, 02:33 AM
  5. Stocks: SkyNet Wars: How A Nasdaq Algo Destroyed BATS
    By thoughtomator in forum Economy & Markets
    Replies: 2
    Last Post: 03-27-2012, 08:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •