Logger Explained (Old) - LabMazurokCom/Blockchain GitHub Wiki

Introduction

Our logger gets and saves data about current arbitrage opportunities on several exchanges. It currently lives in Firebase cloud database and the latest entry can be fetched with the following GET request:

https://arbitrage-logger.firebaseio.com/log_btc_usd.json?orderBy=%22$key%22&limitToLast=1

Add &print=pretty at the end to obtain human-readable response:

https://arbitrage-logger.firebaseio.com/log_btc_usd.json?orderBy=%22$key%22&limitToLast=1&print=pretty

New: https://arb-log.firebaseio.com/log_btc_usd.json?orderBy=%22$key%22&limitToLast=1 https://arb-log.firebaseio.com/log_eth_usd.json?orderBy=%22$key%22&limitToLast=1 https://arb-log.firebaseio.com/log_xrp_usd.json?orderBy=%22$key%22&limitToLast=1

Old style: http://lab.mazurok.com/php/rates.php

Example

{
    "1524920719244": {
        "amount": 126116.96420773405,
        "amount_points": [21.5212677516, 1438.92481114872, 2300.1441140777265, 2362.8687258577265, 2390.5754050261266, 2658.6168250261267, 6861.770197826127, 7028.874342208166, 13991.622024793167, 14093.893792843168, 14107.887157029169, 14216.929869229169, 14226.21620922917, 14540.53797467917, 14706.55817117917, 22245.80051267917, 26953.575571494068, 27037.421723543088, 27222.926171143088, 27408.45417154309, 37150.140919193094, 39009.140919193094, 40412.15917154309, 40435.39854404309, 42098.21930323109, 42121.34267478389, 43150.57362718389, 43176.200426328774, 43266.31307015928, 43466.72280711721, 43485.283591137246, 43702.47242998725, 44632.40242998725, 44651.00222798725, 46046.00072798725, 51271.230000987256, 51339.011655987255, 51431.08035398726, 56043.88035398726, 56824.459857987255, 56844.580098468214, 56853.88109846821, 56911.02981352754, 56938.97466335583, 74760.38059250583, 75476.08249850583, 75525.52438227335, 75616.36936547421, 75626.69873822841, 78479.00372147841, 93324.13509589917, 93414.69060844084, 125743.97022489621, 125865.23274994626, 126033.97505730625, 126055.94991300625, 126107.16665773405, 126116.96420773405],
        "optimal_point": {
            "amount": 93324.13509589917,
            "profit": 331.6526282718571
        },
        "orders": {
            "asks": {
                "exmo": [9331.0, 13.548026740000003]
            },
            "bids": {
                "bitstamp": [9334.26, 5.518696120000002],
                "gdax": [9333.62, 8.02933062]
            }
        },
        "profit": 357.16102564717124,
        "profit_points": [0.20832377580000153, 11.609050378679925, 18.536171354373295, 19.027557019073296, 19.2086157817733, 20.959060881773304, 47.49599580767337, 48.486471425633376, 89.68128884063358, 90.27156822133358, 90.35127239353358, 90.96882098653357, 91.02107098653357, 92.76715259303357, 93.63549719453357, 132.25271202953368, 156.34120621463344, 156.77022576161346, 157.66403456161348, 158.5342905616135, 204.21908080691367, 212.07308080691377, 217.9991159427138, 218.0953934427138, 224.8673044989139, 224.9601044181139, 228.97386160611393, 229.0733097898264, 229.42280666592023, 230.18821487639335, 230.25861381635335, 231.08215166535336, 234.57815166535346, 234.64687366535347, 239.78737366535353, 259.03644408395365, 259.2861429549537, 259.6235301837537, 276.5073701837541, 279.34851171175416, 279.42028227429205, 279.45313227429205, 279.6364707779713, 279.69830456717807, 315.76201919567876, 316.8255890881788, 316.88960567415756, 316.9836696537996, 316.9941492525996, 319.7011625610997, 331.6526282718571, 331.7236875491908, 356.9539462330075, 357.0324946395712, 357.13415970897125, 357.14268585877124, 357.15827464717125, 357.16102564717124],
        "ticker": [{
            "ask": "9340.97",
            "bid": "9338.59",
            "exchange": "bitstamp"
        }, {
            "ask": 9337.8,
            "bid": 9326.9,
            "exchange": "cex"
        }, {
            "ask": "9249.06",
            "bid": "9247.96",
            "exchange": "exmo"
        }, {
            "ask": "9334.27",
            "bid": "9334.26",
            "exchange": "gdax"
        }],
        "trade_cnt": 58
    }
}

Fields

Each key is a Unix timestamp in milliseconds (1s = 1000ms).

Request Description
limitToLast how many records do you want
print=pretty adds new lines and indents to understand the text
Field Description
amount sum of all ask orders for current arbitrage opportunities
amount_points are generated during arbitrage estimation, used for plotting
optimal point "smart" estimation of profit to volume estimation
orders which orders should be put on which exchanges
profit maximum profit which can be obtained with current arbitrage opportunities
profit_points are generated during arbitrage estimation, used for plotting
ticker best prices on each exchange
trade_cnt number of matching pairs in united order book, needn't be equal to length of "orders" array

To Be Done

  • Unified prices representation in ticker
  • Do we really need trade_cnt?
  • Perhaps we should use Firebase-generated key and add timestamp as a field?
  • Do we need to log data which is used for plotting only?