LUCIT-Systems-and-Development / unicorn-binance-local-depth-cache

A Python SDK by LUCIT for accessing and managing multiple local Binance order books with Python in a simple, fast, flexible, robust and fully featured way.
https://unicorn-binance-local-depth-cache.docs.lucit.tech/
Other
36 stars 10 forks source link

Ip ban when using ‘create_depth_cache’ with many symbols #30

Closed mrandybu closed 2 months ago

mrandybu commented 1 year ago

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

taekop commented 1 year ago

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

oliver-zehentleitner commented 1 year ago

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.

alekiv commented 8 months ago

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?

oliver-zehentleitner commented 7 months ago

Will be rolled out on Monday

oliver-zehentleitner commented 7 months ago

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 commented 2 months ago

Will be fixed in the next release.

oliver-zehentleitner commented 2 months ago

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