sleeyax / voltra

Cross-market volatile cryptocurrency trading bot
GNU General Public License v3.0
37 stars 4 forks source link

Error on live mode: panic: runtime error: invalid memory address or nil pointer dereference #12

Open asonaph opened 6 months ago

asonaph commented 6 months ago

Describe the bug The error occurs when test mode is disabled, manifesting after a successful token purchase.

[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5a3b34d]

goroutine 7 [running]:
github.com/sleeyax/voltra/internal/bot.(*Bot).sell(0xc000078690, {0x5c2a0e0, 0xc0001df7c0}, 0xc0000ac360?)
    /github/workspace/internal/bot/bot.go:191 +0x2ed
created by github.com/sleeyax/voltra/internal/bot.(*Bot).Start in goroutine 1
    /github/workspace/internal/bot/bot.go:58 +0x157

Steps to reproduce Disabling test mode; it runs normally while in test mode.

enable_test_mode: false

Steps:

Screenshots

image

System information

sleeyax commented 6 months ago

Thank you for reporting this issue. If you can find your way compiling the go source code in this repository I would appreciate an error log of a debug build so I can better pinpoint the exact location of the nil pointer. If not, that's fine though. This needs to be investigated.

asonaph commented 6 months ago
image

I am new to Go, so I am trying to run a debug on this code. The problem may occur when boughtCoin.TakeProfit is nil. I am trying to understand and fix it. I will update you soon.

sleeyax commented 6 months ago

Thank you for trying to contribute to the project, I appreciate that a lot! I'm here if you need any help or have other questions.