node-binance-trader: Signals no longer received
I’m trying to debug an issue wherein I seem no longer to receive any signals. This is using master. I have a strategy favourited. With the trader running in node, if I watch the signals being transmitted by the strategy using the bva website, I can see that signals are happening but they aren’t being received by the trader. This was working (thus my other bug about unknown pairs), but seems to have stopped.
The startup messages don’t reveal much:
user@user-7490-mint:~/localdev/node-binance-trader$ npm run trader
> node-binance-trader@0.3.1 trader /home/user/localdev/node-binance-trader
> node ./src/trader.js
NBT auto trader running.
Exchange Minimums: [
'ETHBTC', 'LTCBTC', 'BNBBTC', 'NEOBTC', 'QTUMETH', 'EOSETH',
'SNTETH', 'BNTETH', 'BCCBTC', 'GASBTC', 'BNBETH', 'BTCUSDT',
'ETHUSDT', 'HSRBTC', 'OAXETH', 'DNTETH', 'MCOETH', 'ICNETH',
'MCOBTC', 'WTCBTC', 'WTCETH', 'LRCBTC', 'LRCETH', 'QTUMBTC',
'YOYOBTC', 'OMGBTC', 'OMGETH', 'ZRXBTC', 'ZRXETH', 'STRATBTC',
'STRATETH', 'SNGLSBTC', 'SNGLSETH', 'BQXBTC', 'BQXETH', 'KNCBTC',
'KNCETH', 'FUNBTC', 'FUNETH', 'SNMBTC', 'SNMETH', 'NEOETH',
'IOTABTC', 'IOTAETH', 'LINKBTC', 'LINKETH', 'XVGBTC', 'XVGETH',
'SALTBTC', 'SALTETH', 'MDABTC', 'MDAETH', 'MTLBTC', 'MTLETH',
'SUBBTC', 'SUBETH', 'EOSBTC', 'SNTBTC', 'ETCETH', 'ETCBTC',
'MTHBTC', 'MTHETH', 'ENGBTC', 'ENGETH', 'DNTBTC', 'ZECBTC',
'ZECETH', 'BNTBTC', 'ASTBTC', 'ASTETH', 'DASHBTC', 'DASHETH',
'OAXBTC', 'ICNBTC', 'BTGBTC', 'BTGETH', 'EVXBTC', 'EVXETH',
'REQBTC', 'REQETH', 'VIBBTC', 'VIBETH', 'HSRETH', 'TRXBTC',
'TRXETH', 'POWRBTC', 'POWRETH', 'ARKBTC', 'ARKETH', 'YOYOETH',
'XRPBTC', 'XRPETH', 'MODBTC', 'MODETH', 'ENJBTC', 'ENJETH',
'STORJBTC', 'STORJETH', 'BNBUSDT', 'VENBNB',
... 1263 more items
]
Open Trades #: 1
Open Trades: { ONGUSDT608: true }
Additionally, where I use to see the message “NBT HUB => user strategies + trading setup updated” when I made changes on BVA, those messages no longer come through when I make a change.
Two questions:
- Should there always be a connection to https://nbt-hub.herokuapp.com:443 open, continuously? I’m seeing it be established but then drop after 4 minutes - no messages in the console. Still no strategy change messages even when it is connected.
- At line 80 of trader.js I see
socket.on("connect", () => {
console.log("Auto Trader connected.".grey)
})
This message is never emitted. Is that expected?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 29 (20 by maintainers)
So I think have worked this out. Three factors have converged to create a hole I largely dug myself into. Thank you both for your assistance and patience in helping me get to the bottom of this.
Failure 1: When I signed up at BVA, there was a typo in my email address. This wasn’t a direct issue as I still had a valid BVA key, but when the account got locked (I’m not sure it’s clear how that happened some time ago), @jsappme emailed me to tell me but I obviously didn’t get it. Had I got it, then after unlocking my docker container would have worked and I could then have deduced failure 2. I’m going to create a new account with the correct email address so if you want to/can destroy the current one please do.
Failure 2: The very first time I checked out, I missed out on the instruction
npm i --unsafe-perm
. Instead when trying to run I got various missing module errors until the program ran without errors. Somehow I ended up with lots of modules missing, and the program still starting without error. After I rannpm i
, everything was installed and the trader now functions correctly (since the account is also unlocked). I’ve tried to reproduce this a VM by intentionally missing out thenpm i
and installing according to errors, but after onesudo npm install express
all the other modules are installed and it works. I don’t think I’ll be able to repeat this.Failure 3 Locked account. Possibly some combination of testing I did some weeks ago when this first failed caused the account to be locked, possibly something else happened. There’s no feedback from the trader when the account is locked and it fails to do whatever it should do. I’m guessing @jsappme found out via some security warning? Is an enhancement to print an error message similar to that printed when you have got the BVA key wrong appropriate?
I learnt during this process that you can get socket.io to print out debug information by doing
Then you can see the message contents without having to do an HTTPS MITM attack.
I can now head back to the USDT branch and try to get that working.
There may have been some runs some weeks ago with no key specified when I was first setting up, are they cumulative over time? There can only have been one or two today when I was intentionally getting it wrong.
In any case it’s still not working now.
Too many authentication failures (wrong bva key) triggering a ban of the user by the Hub.
Here’s the steps to reproduce:
.env
and only set the valueBVA_API_KEY
. Only virtual trades are selected for testing, so no need to connect to Binance (although it doesn’t make a difference if you do put binance creds in).npm run trader
The installed version of nodejs is 10.9.0. The program runs without error. Margin pairs and minimums are printed to the screen. Open trades associated with the BVA account are correctly listed. Problem 1: The startup message
Auto Trader connected
is never emitted.Run netstat to see active https connections:
Two connections are present. Wait 4 minutes. Run netstat again.
Problem 2: One of the two https connections has disappeared. Is this expected?
Go to the BVA account and make a change to the followed strategies, or the amount traded, resulting in a user_payload signal being sent to the trader. Problem 3: The log message
**NBT HUB => user strategies + trading setup updated
is never emitted.Wait for a trade signal to be emitted from a followed strategy. Problem 4: The signal isn’t received at the trader. Nothing is output at the console.
Log files: https://gist.github.com/realflash/7a19826b207261bfc1f8a5309fcd40e9