UPetit / python-binance-profit

Script to submit a buy order followed by an automatic sell OCO order
MIT License
47 stars 15 forks source link

Caching Feature #17

Closed firwer closed 3 years ago

firwer commented 3 years ago

Hello there! I tried the market order function and it works very well. I just got one feedback for the program.

Would it be possible to introduce a caching system into the program such that the order/trading speed can be improved on? In short, the communication and execution time taken between the program and binance api can shortened for rapid order execution.

Cheers!

PhilippeGalvan commented 3 years ago

Hello @firwer,

Thanks for the feedback.

In the current way buy/sell cycle is made, I don't think any caching could improve the order/trading speed. From my current understanding every call made to binance api is a "refresh" or "action" call which shouldn't be cached in order to work as excepted, there are 2 bottlenecks: Binance API and buy order completion time.

@UPetit will correct me if I'm wrong but here is the actual buy/sell order life cycle in the script. No call is trully idempotent even the getStatus which we actually check for a change of state.

buy sell cycle

However, if you consider that a value won't be updated in a reasonable amount of time (like symbol informations), this value could be cached (or persisted locally) if the cost of operation and implementation vs efficiency gain is worth it.

UPetit commented 3 years ago

@PhilippeGalvan You're right! I will double check Binance API if they are mentioning a caching feature somewhere.

@firwer Did you use a script that is using a caching system? If yes, could you please share the link or the documentation? Thank you

UPetit commented 3 years ago

I'm closing this issue as it doesn't seem to be possible here. Happy to re-open it if needed.