Bot (Configuration Files) - LabMazurokCom/Blockchain GitHub Wiki

Description

bot_config.json

It is the main configuration file. It specifies bot parameters:

  • limit (how many top orders to take from each exchange's order books)
  • config_file (technical details of interaction with exchnges' API)
  • exchs_credentials (API keys required to perform trading actions on exchanges)
  • pairs (list of currency pairs to be monitored)

config_file

Currently orders_config.json. It is a configuration file with technical details of interaction with exchanges' API. Struct of file:

  • exchange - outer key. For every exchange there are following fields:
  • converter - converter for pairs from our signature ('basecur_quotecur') to exchange's signature (e.g. 'BASECUR/QUOTECUR'). It contains all tradable pairs on current exchange.
  • currency_converter - converter for currencies from our signature ('currency') to exchange's signature (e.g. 'CURRENCY'). It contains all available currencies on current exchange.
  • path - path to asks and bids in order book. Contains the full path from JSON response to get order book.
  • fields - path from path to price of order and volume of order. Can contain indices of array or names of fields.
  • url - pattern for url path to get order book. The first {} is for currency_pair and the second {} is for limit.

exchs_credentials

Currently exchs_credentials.json. It is a configuration file with API keys required to perform trading actions on exchanges. For each EXCHANGE (currently cex, exmo, kraken and cryptopia are mentioned here) this file has the following fields:

  • EXCHANGE_endpoint: API endpoint URL
  • EXCHANGE_api_key: public API key
  • EXCHANGE_api_secret: secret API key
  • (CEX only) cex_id: user id

Examples

  • bot_config.json
{
  "limit": 50,
  "config_file": "orders_config.json",
  "exchs_credentials": "exchs_credentials.json",
  "pairs": [
    "bch_btc",
    "bch_usd",
    "btc_usd"
  ]
}

  • exchs_credentials
{
  "cex_endpoint": "https://cex.io/api",
  "cex_api_key": "public key",
  "cex_api_secret": "secret key",
  "cex_id": "user id",

  "exmo_endpoint": "https://api.exmo.com",
  "exmo_api_key": "public key",
  "exmo_api_secret": "secret key",
}

  • config_file
   "bitstamp": {
        "converter": {
            "bch_btc": "bchbtc",
            "bch_eur": "bcheur",
            ...
            "xrp_eur": "xrpeur",
            "xrp_usd": "xrpusd"
        },
        "currency_converter": {
            "bch": "bch",
            "btc": "btc",
            ...
            "usd": "usd",
            "xrp": "xrp"
        },
        "fields": {
            "price": 0,
            "volume": 1
        },
        "path": {
            "asks": [
                "asks"
            ],
            "bids": [
                "bids"
            ]
        },
        "url": "https://www.bitstamp.net/api/v2/order_book/{}/"
    },
    "bittrex": {
        "converter": {
            "2give_btc": "BTC-2GIVE",
            "aby_btc": "BTC-ABY",
            ...
            "zrx_btc": "BTC-ZRX",
            "zrx_eth": "ETH-ZRX"
        },
        "currency_converter": {
            "2give": "2GIVE",
            "aby": "ABY",
            ...
            "zen": "ZEN",
            "zrx": "ZRX"
        },
        "fields": {
            "price": "Rate",
            "volume": "Quantity"
        },
        "path": {
            "asks": [
                "result",
                "sell"
            ],
            "bids": [
                "result",
                "buy"
            ]
        },
        "url": "https://bittrex.com/api/v1.1/public/getorderbook?market={}&type=both"
    },
    "cex": {
        "converter": {
            "bch_btc": "BCH/BTC",
            "bch_eur": "BCH/EUR",
            ...
            "zec_gbp": "ZEC/GBP",
            "zec_usd": "ZEC/USD"
        },
        "currency_converter": {
            "bch": "BCH",
            "btc": "BTC",
            ...
            "xrp": "XRP",
            "zec": "ZEC"
        },
        "fee": 0.0025,
        "fields": {
            "price": 0,
            "volume": 1
        },
        "path": {
            "asks": [
                "asks"
            ],
            "bids": [
                "bids"
            ]
        },
        "url": "https://cex.io/api/order_book/{}/?depth={}"
    },
    "exmo": {
        "converter": {
            "bch_btc": "BCH_BTC",
            "bch_eth": "BCH_ETH",
            ...
            "zec_rub": "ZEC_RUB",
            "zec_usd": "ZEC_USD"
        },
        "currency_converter": {
            "bch": "BCH",
            "btc": "BTC",
            ...
            "xrp": "XRP",
            "zec": "ZEC"
        },
        "fee": 0.002,
        "fields": {
            "price": 0,
            "volume": 1
        },
        "path": {
            "asks": [
                "{}",
                "ask"
            ],
            "bids": [
                "{}",
                "bid"
            ]
        },
        "url": "https://api.exmo.com/v1/order_book/?pair={}&limit={}"
    },
    "gdax": {
        "converter": {
            "bch_btc": "BCH-BTC",
            "bch_eur": "BCH-EUR",
            ...
            "usd_eth": "ETH-USD",
            "usd_ltc": "LTC-USD"
        },
        "currency_converter": {
            "bch": "BCH",
            "btc": "BTC",
            ...
            "to": "to",
            "usd": "USD"
        },
        "fee": 0.003,
        "fields": {
            "price": 0,
            "volume": 1
        },
        "path": {
            "asks": [
                "asks"
            ],
            "bids": [
                "bids"
            ]
        },
        "url": "https://api.gdax.com/products/{}/book?level=2"
    },
    "kraken": {
        "converter": {
            "bch_btc": "BCHXBT",
            "bch_eur": "BCHEUR",
            ...
            "zec_jpy": "XZECZJPY",
            "zec_usd": "XZECZUSD"
        },
        "currency_converter": {
            "bch": "BCH",
            "btc": "BTC",
            ...
            "xrp": "XRP",
            "zec": "ZEC"
        },
        "fee": 0.0026,
        "fields": {
            "price": 0,
            "volume": 1
        },
        "path": {
            "asks": [
                "result",
                "{}",
                "asks"
            ],
            "bids": [
                "result",
                "{}",
                "bids"
            ]
        },
        "url": "https://api.kraken.com/0/public/Depth?pair={}&count={}"
    }