0xMatthieu / Simple_arbitrage_algo

MIT License
0 stars 0 forks source link

Crypto_arbitrage_bot

how to start run python My_discord.py

what should it do ?

Goal is to provide an arbitrage bot on predefined CEX (centralized exchange). The software implements an abstraction layer to separate logic from IO (in this case requests to CEX) There is 3 different functions executed:

current situation

problem is: how to run asychrone or in parallel the software to speed up the whole process Kucoin_trade.websocket_get_tickers_and_account_balance(0) use asyncio by default, it comes from an asbraction library (python-kucoin) which implements a websocket reading stream with asyncio The fact that a mandatory part implements asyncio creates some issues

Currently the main code is in My_discord.py in discord_arbitrage_run().

A solution might be to use asyncio to run asyn tasks and run_in_executor for arbitrage (which includes pandas) but after some tests it seems that the websocket stream is never awaited. It is fine cause I would like to read the stream as fast as possible but also run the run arbitrage function with job "do_arbitrage" to perform arbitrage and also update_list to use the REST api to find new opportunities.

update 11/09/2022

New software with concurrent.futures Problems to fix: