guldo111 / triangular-arbitrage-bot-multi-exchange

Triangular Arbitrage Bot automates profitable cryptocurrency trading by scanning for price discrepancies across exchanges and executing trades to exploit arbitrage opportunities on popular cryptocurrency exchanges such as Binance, Kucoin, OKEx, and Huobi.
MIT License
10 stars 7 forks source link

Not executing any trades #3

Open TestGithub2024m opened 3 months ago

TestGithub2024m commented 3 months ago

the bot keeps finding arbitrage opportunities but does not go through with the trade? i have 5 usdt in each exchange platform, can you tell me why nothing is happening?

log =

2024-03-16 19:08:19,665 Finding arbitrage opportunities. 2024-03-16 19:08:19,666 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:19,666 Finding arbitrage opportunities. 2024-03-16 19:08:19,667 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:19,667 Finding arbitrage opportunities. 2024-03-16 19:08:19,667 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:19,667 Finding arbitrage opportunities. 2024-03-16 19:08:19,668 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:39,574 Finding arbitrage opportunities. 2024-03-16 19:08:39,578 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:39,578 Finding arbitrage opportunities. 2024-03-16 19:08:39,578 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:39,578 Finding arbitrage opportunities. 2024-03-16 19:08:39,579 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:39,579 Finding arbitrage opportunities. 2024-03-16 19:08:39,579 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:57,146 Finding arbitrage opportunities. 2024-03-16 19:08:57,153 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:57,153 Finding arbitrage opportunities. 2024-03-16 19:08:57,154 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:57,154 Finding arbitrage opportunities. 2024-03-16 19:08:57,154 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:08:57,155 Finding arbitrage opportunities. 2024-03-16 19:08:57,155 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:09:16,499 Finding arbitrage opportunities. 2024-03-16 19:09:16,501 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:09:16,501 Finding arbitrage opportunities. 2024-03-16 19:09:16,502 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:09:16,502 Finding arbitrage opportunities. 2024-03-16 19:09:16,502 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:09:16,502 Finding arbitrage opportunities. 2024-03-16 19:09:16,503 CSV file is empty. No arbitrage opportunities. 2024-03-16 19:09:19,589 Arbitrage opportunity found. Checking liquidity on Kucoin... 2024-03-16 19:09:19,589 Before opportunity check on Kucoin: first_symbol= VRA/USDT, first_price = 0.01111, second_symbol = VRA/USDC second_price = 0.011192, third_symbol = USDC/USDT, third_price = 1.00078, profit percentage: 0.81600 2024-03-16 19:09:19,589 Calculating price impact 2024-03-16 19:09:20,495 Order books fetched on KuCoin 2024-03-16 19:09:20,500 Processing order book for VRA/USDT with side buy and order size 1.0 2024-03-16 19:09:20,501 Order book prices: [1.10900000e-02 1.11000000e-02 1.11100000e-02 ... 1.14257856e+04 5.00000000e+04 1.00000000e+07] 2024-03-16 19:09:20,501 Order book volumes: [3.81018000e+04 1.84166100e+06 9.48184000e+04 ... 1.14257856e+04 5.00000000e+04 8.00740800e+02] 2024-03-16 19:09:20,501 At price level 0.01109: volume_for_this_order=1.0, value_for_this_order=0.01109 2024-03-16 19:09:20,502 Price impact for VRA/USDT: 0.01109 2024-03-16 19:09:20,502 Processing order book for VRA/USDC with side sell and order size 90.009 2024-03-16 19:09:20,502 Order book prices: [1.1192e-02 1.1080e-02 1.1069e-02 1.1066e-02 1.1062e-02 1.1049e-02 1.1033e-02 1.1024e-02 1.0989e-02 1.0968e-02 1.0945e-02 1.0917e-02 1.0913e-02 1.0858e-02 1.0824e-02 1.0821e-02 1.0820e-02 1.0769e-02 1.0749e-02 1.0743e-02 1.0713e-02 1.0712e-02 1.0703e-02 1.0702e-02

guldo111 commented 3 months ago

Hi, sorry for replying only here:

does the script stopped?

in the log, don't you find this lines after calculate price impact?

After liquidity check on {exchange_name}: first_symbol= {first_symbol}, first_price = {first_price_impact}, second_symbol = {second_symbol} second_price = {second_price_impact}, third_symbol = {third_symbol}, third_price = {third_price_impact}, profit percentage: {real_profit_percentage}')

the goal of that price impact calculation was to avoid opportunities which the order would have caused too much slippage, but it's a lot of time that i don't test this. might return working on it in the following months

TestGithub2024m commented 3 months ago

Hi, sorry for replying only here:

does the script stopped?

in the log, don't you find this lines after calculate price impact?

After liquidity check on {exchange_name}: first_symbol= {first_symbol}, first_price = {first_price_impact}, second_symbol = {second_symbol} second_price = {second_price_impact}, third_symbol = {third_symbol}, third_price = {third_price_impact}, profit percentage: {real_profit_percentage}')

the goal of that price impact calculation was to avoid opportunities which the order would have caused too much slippage, but it's a lot of time that i don't test this. might return working on it in the following months

Hi not to worry its ok, and we appreciate all the time and effort that's gone into the program, it's just a shame there is a couple of issues here and there that need correcting, have you actually had this working where it does the trade and makes a profit? i had it running for around 5-6 hours yesterday and it didn't manage to execute a single trade! have you tried using chat-gpt to fix any issues it takes a fraction of the time but can sometimes cause more issues if not done right lol

and yes i have i had calculating price impact after those lines in the log, but it says percentage profit: 0.49, my threshold is set to 0.3 so technically it should have executed the trade?

log =

2024-03-16 18:39:16,091 Arbitrage opportunity not confirmed on Kucoin. 2024-03-16 18:39:30,225 Finding arbitrage opportunities. 2024-03-16 18:39:30,228 CSV file is empty. No arbitrage opportunities. 2024-03-16 18:39:30,228 Finding arbitrage opportunities. 2024-03-16 18:39:30,228 CSV file is empty. No arbitrage opportunities. 2024-03-16 18:39:30,228 Finding arbitrage opportunities. 2024-03-16 18:39:30,229 CSV file is empty. No arbitrage opportunities. 2024-03-16 18:39:30,229 Finding arbitrage opportunities. 2024-03-16 18:39:30,229 CSV file is empty. No arbitrage opportunities. 2024-03-16 18:39:35,025 Arbitrage opportunity found. Checking liquidity on Kucoin... 2024-03-16 18:39:35,025 Before opportunity check on Kucoin: first_symbol= ACQ/USDT, first_price = 0.023695, second_symbol = ACQ/USDC second_price = 0.023803, third_symbol = USDC/USDT, third_price = 1.00042, profit percentage: 0.49700 2024-03-16 18:39:35,025 Calculating price impact 2024-03-16 18:39:35,698 Order books fetched on KuCoin 2024-03-16 18:39:35,699 Processing order book for ACQ/USDT with side buy and order size 1.0 2024-03-16 18:39:35,699 Order book prices: [2.36950000e-02 2.37050000e-02 2.37340000e-02 ... 5.50000000e+02 7.98080400e+02 1.00000835e+03] 2024-03-16 18:39:35,699 Order book volumes: [1.71875880e+03 2.19932000e+03 8.32056800e+02 ... 3.88619224e+04 1.05600000e+01 1.22715980e+03] 2024-03-16 18:39:35,699 At price level 0.023695: volume_for_this_order=1.0, value_for_this_order=0.023695 2024-03-16 18:39:35,700 Price impact for ACQ/USDT: 0.023695 2024-03-16 18:39:35,700 Processing order book for ACQ/USDC with side sell and order size 42.202996 2024-03-16 18:39:35,700 Order book prices: [0.023803 0.023581 0.023576 0.023507 0.023359 0.023269 0.023137 0.023095 0.022966 0.022915 0.022694 0.022693 0.022683 0.022667 0.022471 0.022372 0.022271 0.022249 0.022081 0.022027 0.021859 0.021805 0.021793 0.021583 0.021509 0.021447 0.021361 0.021229 0.021139 0.021035 0.020952 0.020917

I also had this error in another log where is says Placing first order: but then failed?

File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ccxt/async_support/htx.py", line 4889, in create_spot_order_request raise InvalidOrder(self.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend(amount price), alternatively set the createMarketBuyOrderRequiresPrice option or param to False and pass the cost to spend in the amount argument') ccxt.base.errors.InvalidOrder: huobi createOrder() requires the price argument for market buy orders to calculate the total cost to spend(amount price), alternatively set the createMarketBuyOrderRequiresPrice option or param to False and pass the cost to spend in the amount argument Arbitrage opportunities found, checking liquidity Placing first order: 5.7422 KCAL/USDT An error occurred: huobi createOrder() requires the price argument for market buy orders to calculate the total cost to spend(amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to False and pass the cost to spend in the amount argument Traceback (most recent call last): File "/Users//Desktop/My-Arbitrage-Bot/triangular-arbitrage-bot-multi-exchange-main/tri_arb_bot.py", line 491, in main await asyncio.gather( File "/Users//Desktop/My-Arbitrage-Bot/triangular-arbitrage-bot-multi-exchange-main/tri_arb_bot.py", line 384, in find_triangular_arbitrage_opportunities profit, final_amount = await execute_trade(