unicorn-binance-local-depth-cache icon indicating copy to clipboard operation
unicorn-binance-local-depth-cache copied to clipboard

Ip ban when using ‘create_depth_cache’ with many symbols

Open mrandybu opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe.

When passing list with many symbols in create_depth_cache method we getting ip ban, because ubldc sent rest to binance by each symbol.

Describe the solution you'd like.

No response

Describe alternatives you've considered

No response

Additional context

No response

mrandybu avatar Nov 25 '22 20:11 mrandybu

I think a good way to handle a lot of symbols is to call 'create_depth_cache' slowly for each market, say 60 markets per minute.

for market in markets:
    time.sleep(1)
    ubldc.create_depth_cache(markets=market)

Unfortunately, because markets are added during the iteration, error is often raised.

RuntimeError: dictionary changed size during iteration

https://github.com/LUCIT-Systems-and-Development/unicorn-binance-local-depth-cache/blob/c61d111dc4c252cdd5fbb272e70b6b8c5d2393b2/unicorn_binance_local_depth_cache/manager.py#L467

taekop avatar Jun 21 '23 07:06 taekop

i will include a built in solution that takes the current weight cost into account and simply does not exceed it. this way the coder does not have to pay attention to it anymore and no fixed delays are necessary. Due to a restructuring at LUCIT I will not be able to provide an update until the end of July.

oliver-zehentleitner avatar Jun 21 '23 15:06 oliver-zehentleitner

i will include a built in solution that takes the current weight cost into account and simply does not exceed it. this way the coder does not have to pay attention to it anymore and no fixed delays are necessary. Due to a restructuring at LUCIT I will not be able to provide an update until the end of July.

Any updates on this?

alekiv avatar Nov 27 '23 21:11 alekiv

Will be rolled out on Monday

oliver-zehentleitner avatar Dec 08 '23 13:12 oliver-zehentleitner

I have noticed in tests that the current architecture with many caches does not scale well. For example, we use one WebSocket connection per cache. This may be good for a few caches, but not for many. I will rewrite some things and then publish an update. But I don't think I'll be able to do that before Christmas.

oliver-zehentleitner avatar Dec 13 '23 10:12 oliver-zehentleitner

Will be fixed in the next release.

oliver-zehentleitner avatar May 11 '24 08:05 oliver-zehentleitner

2.0.0 has been released https://pypi.org/project/unicorn-binance-local-depth-cache/

oliver-zehentleitner avatar May 17 '24 23:05 oliver-zehentleitner