mehtadone / PTFeeder

Official GitHub for ProfitTrailer's best buddy, PT Feeder. Be sure to visit their GitHub too.
https://wiki.ptfeeder.co/
183 stars 33 forks source link

[REQUEST] Feed multiple markets with a single instance #316

Closed NOP-Commander closed 6 years ago

NOP-Commander commented 6 years ago

Dear developers,

for research reasons i temporarily ran 2 instances of PTFeeder (EDIT btw: i'm still on 1.4) on my VPS. By that time i just had 2GB of RAM. Meanwhile i upgraded to 8GB (with 6 Cores) but dotnet is a bitch in terms of memory allocation and garbage collection (or I'm just a damn dotnet-on-linux-noob, don't know). I restart PTFeeder daily via cron to avoid swapping (yes, real swapping getting worse by time, i checked with vmstat) and insane loadavg on the cpu (had a peak of 15 on 1 min after 2 days). Maybe you can tweak some GC or whatever settings in the runtime properties of PTFeeder's dotnet config file but i haven't researched plus i think the default settings you provide are good to go. So basically this is my kinda painful technical background.

My idea/proposal is to feed multiple markets (BTC, ETH, USDT etc.) with a single instance. If this would impact API Request Limits which can't be handled by internal throttling or whatever technique this idea is already obsolete by now. On the other hand, running more than one instance of PTFeeder on a single VPS with a single IP (not an uncommon scenario i suppose if you have enough resources and are "crazy" enough) would be a higher "risk" for violating API Request Limits because both instances just run in their own scope. So that would basically be a plus for the idea of integration.

When it comes to implementation i wanted to keep it simple and it would look like this. Sorry for the old school 1.4 syntax. I haven't migrated to 1.5 yet but if you get my idea this concept -whatever it's worth- could be implemented in 1.5 config style syntax aswell.

hostsettings.json: { "Host": { "LicenseKey": "XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX", // "ServerUrls": "http://localhost:9083",

// Some of the following settings can more or less be moved to the config sections
// of the instance but that depends on the (non)sense and the effort needed for implementing it

"HostName": "",
"MarketConditionCheckInMinutes": "3",
"CalculateTrailingValues": "true",
"UseMaxCostPercentage": "true",
"UseMinBuyBalancePercentage": "true",
"TelegramBotId": "",
"TelegramChatId": "",
"TestMode": "false",

"Instance": [
{
    "Name": "BTC",
    "ProfitTrailerFolder1": "/opt/profittrailer-btc-binance",
    "ProfitTrailerFolder2": "/opt/profittrailer-btc-bittrex",
    "ProfitTrailerFolder3": "/opt/profittrailer-btc-poloniex",
},
{
    "Name": "ETH",
    "ProfitTrailerFolder1": "/opt/profittrailer-eth-binance",
    "ProfitTrailerFolder2": "/opt/profittrailer-eth-bittrex",
    "ProfitTrailerFolder3": "/opt/profittrailer-eth-poloniex",
},
{
    "Name": "USDT",
    "ProfitTrailerFolder1": "/opt/profittrailer-usdt-binance",
    "ProfitTrailerFolder2": "/opt/profittrailer-usdt-bittrex",
    "ProfitTrailerFolder3": "/opt/profittrailer-usdt-poloniex",
},

}, "Serilog": { "MinimumLevel": "Information" }, }

sincerely yours, NOP-Commander

p.s.: thanks for your fine piece of software.

NOP-Commander commented 6 years ago

One more comment. To run such a super setup with up to 9 instances at the same time (why not? (; ) there is a technical prerequisite for ProfitTrailer which I requested here: https://github.com/taniman/profit-trailer-enhancements/issues/274 Without that feature you have to manually start/stop your ProfitTrailer instances to avoid being (temp) banned, especially on Binance. But every Marketplace could change their api usage terms so with that feature we would be in a safer harbor.

mehtadone commented 6 years ago

Moved to forum:

http://forum.ptfeeder.co/t/feed-multiple-markets-with-a-single-instance/27