bmino / binance-triangle-arbitrage

Detect in-market cryptocurrency arbitrage
MIT License
1.07k stars 337 forks source link

Age keeps increasing indefinetly #152

Closed gaffelosked closed 3 years ago

gaffelosked commented 3 years ago

m5n.xlarge in Tokyo region 17ms. CPU clock 76%. WebSockets gets terminated. Same happens for EUR. image

`{

"INVESTMENT": {
    "USDT": {
        "MIN": 10,
        "MAX": 1000,
        "STEP":1
    }
},

"SCANNING": {
    "DEPTH": 50,
    "WHITELIST": []
},

"EXECUTION": {
    "ENABLED": false,
    "CAP": 1,
    "STRATEGY": "linear",
    "TEMPLATE": ["BUY", "SELL", "SELL"],
    "FEE": 0.075,
    "THRESHOLD": {
        "PROFIT": 0.00,
        "AGE": 25
    }
},

"HUD": {
    "ENABLED": true,
    "ROWS": 10,
    "REFRESH_RATE": 500
},

"LOG": {
    "LEVEL": "debug",
    "PRETTY_PRINT": true,
    "STATUS_UPDATE_INTERVAL": 2
},

"WEBSOCKET": {
    "BUNDLE_SIZE": 10,
    "INITIALIZATION_INTERVAL": 50
},

"BINANCE_OPTIONS": {}

}`

gaffelosked commented 3 years ago

Fixed by getting the best single core clock speed AWS could offer (z1d), still ages are way to high, ~100ms. I'm not an experienced programmer but I would say this needs much CPU optimization. It was fun messing about with at least.

bmino commented 3 years ago

Even with the best CPU, you need to be physically closer to the Binance servers for low latency. Colocation is optimal

bmino commented 3 years ago

The bot only utilizes a single thread, so ramping up your aws instance does not get much more return. Your config iterates 1000 times per update which will likely overwhelm any cpu