bmino/binance-triangle-arbitrage

WARN: Bid depth (0) too shallow to convert

Closed this issue · 12 comments

Hi!

I've recently tried to run your program, and it looks like it works great! However, I've been looking at the logs and it seems like it's been spamming me with bid depth (0) too shallow to convert. I've tried to reduce the depth in the config to 5 or 10, however it errors out. Also, it seems like the websockets will just die randomly. I've looked through all of the other posts in the issues section of this Github repo, but none of the solutions seem to work. (I'm running the latest version.)

WARN: Bid depth (0) too shallow to convert
INFO: WebSocket closed: xxxxxx@depth@100ms (1006)

bmino commented

Bid depth (0) errors are almost always caused by a disconnected websocket, which are almost always caused by a lack of cpu resources to handle so many concurrent connections AND the computations required by the bot

bmino commented

You can try bundling the websockets together to reduce the number of total outstanding ws connections via WEBSOCKET.BUNDLE_SIZE

Hmmm, it seem's like the error is still happening, even though I have increased the websocket bundle size. I'm pretty sure it's not getting bottlenecked by the CPU, since it's just chillin at around 35% utilization (I'm running it on GCP, maybe that's the issue?).

bmino commented

Ensure that 35% isn't your overall cpu usage. This bot is single threaded, so one core might be overworked. I haven't experienced any big performance tweaks bundling websockets but the option is there still.

Personally I always ran on aws, but gcp should be just fine so long as the specs on the box are adequate

bmino commented

Something to keep in mind too is that really low depth cache starting values can actually be exhausted by a lot of market takers. If this is the case, you will still see depth(0) errors, but not websocket disconnection errors

I've tried a bunch of depth cache levels, however it still just spams depth(0) errors. I haven't tried it on one of my computers at home, I will do that and see if it works.

bmino commented

Look in your performance logs and see if there is a line like this:

CPU clock usage for calculations: ...

Hi, I really admire your work in making this program. Regarding this error, I'm also experiencing the same thing and it certainly sounds like it's due to a lack of cpu resources on my end.

Personally I always ran on aws, but gcp should be just fine so long as the specs on the box are adequate

You mentioned that you use aws. What specs do you use?

bmino commented

c5n.large I think. Maybe xlarge but it's been awhile

Hi
I have the same error message
I have try to increase and decrease the WEBSOCKET.BUNDLE_SIZE but it still the same
I have some websocket deconnection but not too often
the cpu usage is about 60-75% (on one core)
Could you explain what "Bid depth (0) too shallow to convert" mean ?
THK

bmino commented

It can be caused by a few reasons but the most common cause is when your cpu (only single core) is overwhelmed and cannot handle the ping pong websocket events so they timeout and disconnect. If your websockets are not disconnecting, this could be from using too low of a depth value and the cached depth gets exhausted at a rate higher than new orders are posted

Hi,

I am getting the same error without disconnection of websocket. I sometimes catch profit but it does not execute.

[1/4/2022, 6:11:44 AM] �[33mWARN�[39m: �[36mAsk depth (0) too shallow to convert 10 BUSD to BNB using BNBBUSD�[39m
[1/4/2022, 6:11:44 AM] �[33mWARN�[39m: �[36mBid depth (0) too shallow to convert 0.019 BNB to BUSD using BNBBUSD�[39m
[1/4/2022, 6:11:44 AM] �[33mWARN�[39m: �[36mAsk depth (0) too shallow to convert 0.019 BNB to XTZ using XTZBNB�[39m
[1/4/2022, 6:11:44 AM] �[33mWARN�[39m: �[36mAsk depth (0) too shallow to convert 263.834 UAH to BUSD using BUSDUAH�[39m