If you are getting the error: TypeError: Cannot read property ‘totalMarginBalance’ of undefined when running Gunbot, today is your lucky day as we are going to explains the way to fix it. There are several things that can do the job, and we will start trying with step 1. In the case an step doesn’t fix it, proceed with next step:
1- Stop the bot. Edit config.js file with any text editor (notepad++ for example). Check for “exchange” section and “market” line, set this one to “futures”, so it looks like this: “market”: “futures”
2- Step 1 fix this issue for most of the people. If it didn’t in your case, try this: Stop the bot. Edit config.js file with any text editor. Check for “start” and change it from “true” to “false”, this way trading core won’t start automatically the next time you access to the GUI. Now set the trading pair that is causing the issue to “false“. Now click on “Start trading“, and enable the trading pair again.
3- In the case steps 1 and 2 didn’t fix it, change your api key for a new one and be sure the api permissions are properly set. If you are running the bot on Binance Futures, api permissions should look like this: