[ { "id": "6d543cb4.ed3084", "type": "tab", "label": "Kraken Trading", "disabled": false, "info": "" }, { "id": "42702610.230028", "type": "kraken-credentials", "z": "", "name": "DFLT" }, { "id": "c0dcbde0.3085", "type": "sqlitedb", "z": "", "db": "KrakenTradingDB.sqlite3", "mode": "RW" }, { "id": "b8c92875.131c58", "type": "get-server-time", "z": "6d543cb4.ed3084", "name": "", "x": 310, "y": 240, "wires": [ [ "63e56415.01466c" ], [ "1637654a.83336b" ] ] }, { "id": "d11eed52.456ac", "type": "inject", "z": "6d543cb4.ed3084", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 120, "y": 240, "wires": [ [ "b8c92875.131c58" ] ] }, { "id": "63e56415.01466c", "type": "debug", "z": "6d543cb4.ed3084", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 560, "y": 240, "wires": [] }, { "id": "1637654a.83336b", "type": "debug", "z": "6d543cb4.ed3084", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 560, "y": 320, "wires": [] }, { "id": "978bdbc5.1c3508", "type": "get-account-balance", "z": "6d543cb4.ed3084", "kraken": "42702610.230028", "name": "", "x": 340, "y": 480, "wires": [ [ "5fd28dbd.7d1504" ], [ "8d9b208b.f68a7" ] ] }, { "id": "5fd28dbd.7d1504", "type": "debug", "z": "6d543cb4.ed3084", "name": "Kraken-Balance", "active": true, "tosidebar": true, "console": true, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 600, "y": 460, "wires": [] }, { "id": "8d9b208b.f68a7", "type": "debug", "z": "6d543cb4.ed3084", "name": "Kraken Balance ERROR", "active": true, "tosidebar": true, "console": true, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 630, "y": 540, "wires": [] }, { "id": "586b4d14.eca6f4", "type": "inject", "z": "6d543cb4.ed3084", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "18000", "crontab": "", "once": false, "onceDelay": 0.1, "x": 130, "y": 480, "wires": [ [ "978bdbc5.1c3508" ] ] }, { "id": "715c2949.e70048", "type": "get-ticker-information", "z": "6d543cb4.ed3084", "name": "", "x": 370, "y": 680, "wires": [ [ "3362bc86.263034", "49e9037c.b0234c" ], [ "c776c3e9.448ed" ] ] }, { "id": "926454.4996abb", "type": "inject", "z": "6d543cb4.ed3084", "name": "", "topic": "", "payload": "{\"pair\":\"XETHZUSD\"}", "payloadType": "json", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 140, "y": 680, "wires": [ [ "715c2949.e70048" ] ] }, { "id": "3362bc86.263034", "type": "debug", "z": "6d543cb4.ed3084", "name": "Kraken TickerData", "active": true, "tosidebar": true, "console": true, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 600, "y": 640, "wires": [] }, { "id": "c776c3e9.448ed", "type": "debug", "z": "6d543cb4.ed3084", "name": "Kraken TickerData ERROR", "active": true, "tosidebar": true, "console": true, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 630, "y": 740, "wires": [] }, { "id": "49e9037c.b0234c", "type": "function", "z": "6d543cb4.ed3084", "name": "compute order", "func": "let askPrice = msg.payload.XETHZUSD.a[0];\nlet volume2Buy = 50/askPrice; // How much Etheream to buy for 50 USD?\nnode.log(\"Ask Price \", askPrice, \" --> Volume : \", volume2Buy );\n\nmsg.payload={\n\tpair : 'XETHZUSD',\n\ttype : 'buy',\n\tordertype : 'limit',\n\tprice : askPrice,\n\tvolume : volume2Buy\n};\n\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 620, "y": 700, "wires": [ [ "c4999094.47952", "ca762b6c.7d98f8" ] ] }, { "id": "c4999094.47952", "type": "add-standard-order", "z": "6d543cb4.ed3084", "kraken": "42702610.230028", "name": "", "x": 840, "y": 700, "wires": [ [ "5baa6fae.59cb2" ], [ "27f87d72.6fa302" ] ] }, { "id": "5baa6fae.59cb2", "type": "debug", "z": "6d543cb4.ed3084", "name": "Kraken OrderFeedback Success", "active": true, "tosidebar": true, "console": true, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 1100, "y": 680, "wires": [] }, { "id": "27f87d72.6fa302", "type": "debug", "z": "6d543cb4.ed3084", "name": "Kraken OrderFeedback ERROR", "active": true, "tosidebar": true, "console": true, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 1110, "y": 720, "wires": [] }, { "id": "ca762b6c.7d98f8", "type": "debug", "z": "6d543cb4.ed3084", "name": "Kraken - OrderInfos", "active": true, "tosidebar": true, "console": true, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 900, "y": 620, "wires": [] }, { "id": "ee195c7.d088ba", "type": "get-ticker-information", "z": "6d543cb4.ed3084", "name": "", "x": 330, "y": 880, "wires": [ [ "4f94e60f.4d3838" ], [ "f163b077.931ff" ] ] }, { "id": "eeb36454.5abdf8", "type": "inject", "z": "6d543cb4.ed3084", "name": "", "topic": "", "payload": "{\"pair\":\"XETCZUSD\"}", "payloadType": "json", "repeat": "60", "crontab": "", "once": false, "onceDelay": 0.1, "x": 140, "y": 880, "wires": [ [ "ee195c7.d088ba" ] ] }, { "id": "a669c08c.d0185", "type": "sqlite", "z": "6d543cb4.ed3084", "mydb": "c0dcbde0.3085", "sqlquery": "msg.topic", "sql": "", "name": "", "x": 830, "y": 820, "wires": [ [] ] }, { "id": "4f94e60f.4d3838", "type": "function", "z": "6d543cb4.ed3084", "name": "Build Insert Statement", "func": "msg.topic=\"Insert into KrakenQuotes (Symbol,Data) values ('XETCZUSD','\" + JSON.stringify(msg.payload.XETCZUSD) + \"');\"\nreturn msg;", "outputs": 1, "noerr": 0, "x": 540, "y": 860, "wires": [ [ "853572da.0b0bf", "a669c08c.d0185" ] ] }, { "id": "853572da.0b0bf", "type": "debug", "z": "6d543cb4.ed3084", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "x": 770, "y": 880, "wires": [] }, { "id": "f163b077.931ff", "type": "debug", "z": "6d543cb4.ed3084", "name": "Error getting Kraken Quote", "active": true, "tosidebar": true, "console": true, "tostatus": false, "complete": "true", "targetType": "full", "x": 570, "y": 920, "wires": [] } ]