Triangular-Arbitrage icon indicating copy to clipboard operation
Triangular-Arbitrage copied to clipboard

Benchmark and Test for Run Time on Exchanges Other than Binance

Open ruidazeng opened this issue 1 year ago • 21 comments

I am using the triangular arbitrage opportunity detection code, and I wanted to know if it has been benchmarked and tested for run time performance on exchanges other than Binance (or BinanceUS). Currently, I am running the code on KuCoin and Coinbase, but no opportunities are being returned from these exchanges. The process seems to be stuck at "scanning" indefinitely.

Is there any known issue or limitation with these exchanges? Are there any specific configurations or modifications required to ensure it runs correctly on non-Binance exchanges?

ruidazeng avatar Oct 08 '24 15:10 ruidazeng

You can check historical detections on https://www.octobot.cloud/tools/triangular-arbitrage-crypto, https://x.com/OctoArbitrage and https://t.me/octobotarbitrage.

It can take a lot of time (up to 1 hour on my computer), it depends on how many pairs are available on the exchange you select.

Herklos avatar Oct 08 '24 19:10 Herklos

Which exchange did you use that took 1 hour on your computer?

ruidazeng avatar Oct 08 '24 21:10 ruidazeng

kraken has been running on my computer for 6 hrs with no result.

PWShawn avatar Oct 08 '24 21:10 PWShawn

Which exchange did you use that took 1 hour on your computer?

Binance & Kucoin & OKX & Crypto.com takes around 1 hour on my computer. Bitget is faster (few minutes).

Herklos avatar Oct 09 '24 07:10 Herklos

@ruidazeng, do you have any benchmarks after the new changes?

Herklos avatar Oct 26 '24 16:10 Herklos

@ruidazeng, do you have any benchmarks after the new changes?

Let me work on it for a bit, I will make a benchmark branch. The thing is the benchmark times are so dependent on the actual exchanges and how many data points we are obtaining (as opposed to our algorithms), I am wondering if there's a way to check how much data is being fed to us by the exchange and compare them to the runtime.

ruidazeng avatar Oct 26 '24 17:10 ruidazeng

Never mind just realize I don't have the perms to make a benchmark branch. Would you be able to make a benchmark branch so I can send some pull request to it. @Herklos

ruidazeng avatar Oct 26 '24 17:10 ruidazeng

@ruidazeng, do you have any benchmarks after the new changes?

Let me work on it for a bit, I will make a benchmark branch. The thing is the benchmark times are so dependent on the actual exchanges and how many data points we are obtaining (as opposed to our algorithms), I am wondering if there's a way to check how much data is being fed to us by the exchange and compare them to the runtime.

No problem, thanks!

Herklos avatar Oct 26 '24 17:10 Herklos

Never mind just realize I don't have the perms to make a benchmark branch. Would you be able to make a benchmark branch so I can send some pull request to it. @Herklos

I have just created it

Herklos avatar Oct 26 '24 17:10 Herklos

Never mind just realize I don't have the perms to make a benchmark branch. Would you be able to make a benchmark branch so I can send some pull request to it. @Herklos

I have just created it

Do you have a list of exchanges you want to benchmark? Do you have data on the top 10 or top 15 most popular exchanges on Octobot via the ccxt library?

ruidazeng avatar Oct 27 '24 02:10 ruidazeng

Never mind just realize I don't have the perms to make a benchmark branch. Would you be able to make a benchmark branch so I can send some pull request to it. @Herklos

I have just created it

Do you have a list of exchanges you want to benchmark? Do you have data on the top 10 or top 15 most popular exchanges on Octobot via the ccxt library?

You can find here our supported exchanges list: https://www.octobot.cloud/en/guides/exchanges

Herklos avatar Oct 27 '24 10:10 Herklos

Never mind just realize I don't have the perms to make a benchmark branch. Would you be able to make a benchmark branch so I can send some pull request to it. @Herklos

I have just created it

Do you have a list of exchanges you want to benchmark? Do you have data on the top 10 or top 15 most popular exchanges on Octobot via the ccxt library?

You can find here our supported exchanges list: https://www.octobot.cloud/en/guides/exchanges

I will focus on the partner exchanges

ruidazeng avatar Oct 27 '24 16:10 ruidazeng

@Herklos I might need a new approach. I ran for 120 hours on my machine and did not finish all the supported exchanges.

ruidazeng avatar Nov 04 '24 17:11 ruidazeng

These are my results after 120 hours:

Scanning exchanges...

Starting detection for Binance (binanceus)...
-------------------------------------------
New 4.51882% Binance opportunity:
-------------------------------------------

Starting detection for OKX (okx)...
-------------------------------------------
New 26.43352% OKX opportunity:
-------------------------------------------

Starting detection for Kucoin (kucoin)...
-------------------------------------------
New 13.641% Kucoin opportunity:
-------------------------------------------

Starting detection for Bybit (bybit)...
An error occurred with Bybit: bybit GET https://api.bybit.com/v5/market/instruments-info?category=option&baseCoin=BTC 403 Forbidden <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
The Amazon CloudFront distribution is configured to block access from your country.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: reMEvhwhCnXoEV9gKTIovhXuZHqNRcWMCt2iRlG1hqWEHduR9zR0sQ==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>

Starting detection for Crypto.com (cryptocom)...
-------------------------------------------
New 9.75882% Crypto.com opportunity:
-------------------------------------------

Starting detection for HTX (huobi)...
-------------------------------------------
New 14.2615% HTX opportunity:
-------------------------------------------

Starting detection for Bitget (bitget)...
-------------------------------------------
New 21.71864% Bitget opportunity:
-------------------------------------------

Starting detection for BingX (bingx)...
An error occurred with BingX: None cannot be a node

Starting detection for MEXC (mexc)...
-------------------------------------------
New 3.30981% MEXC opportunity:
-------------------------------------------

Starting detection for CoinEx (coinex)...
An error occurred with CoinEx: None cannot be a node

Starting detection for BitMart (bitmart)...
-------------------------------------------
New 12.8493% BitMart opportunity:
-------------------------------------------

Starting detection for HollaEx (hollaex)...
No opportunity detected for HollaEx

Starting detection for Phemex (phemex)...
An error occurred with Phemex: None cannot be a node

Starting detection for GateIO (gate)...

ruidazeng avatar Nov 05 '24 05:11 ruidazeng

Hi just a concern, the exchange rate for atom/usdt is not 0.15446, its 6.45 at the current rate. The rest of the rates seem to be accurate.

New 65.5134% bitget opportunity:

  1. buy ATOM with USDT at 0.15446
  2. sell ATOM for BTC at 0.00007
  3. buy TRX with BTC at 390625.00000
  4. sell TRX for ETH at 0.00007
  5. buy LTC with ETH at 32.90556
  6. sell LTC for EUR at 96.58000
  7. buy ADA with EUR at 1.16863
  8. sell ADA for USDC at 0.89230
  9. buy DYDX with USDC at 1.13507
  10. sell DYDX for USDT at 1.44300

RGermain97 avatar Dec 22 '24 21:12 RGermain97

@ruidazeng I've also noticed this weird occurrence with the output, where it will print repetitive steps after a while.


New 10.87529% kucoin opportunity:

  1. buy TRX with KCS at 45.76240
  2. sell TRX for USDC at 0.24456

New 10.87529% kucoin opportunity:

  1. buy TRX with KCS at 45.76240
  2. sell TRX for USDC at 0.24456
  3. buy GMT with USDC at 7.62777
  4. sell GMT for USDT at 0.13370
  5. buy KAI with USDT at 362.31884
  6. sell KAI for BTC at 0.00000
  7. buy GMT with USDC at 7.62777
  8. sell GMT for USDT at 0.13370
  9. buy KAI with USDT at 362.31884
  10. sell KAI for BTC at 0.00000
  11. buy XDC with BTC at 1315789.47368
  12. sell XDC for ETH at 0.00002
  13. buy NEO with ETH at 235.62677
  14. buy XDC with BTC at 1315789.47368
  15. sell XDC for ETH at 0.00002
  16. buy NEO with ETH at 235.62677
  17. sell NEO for KCS at 1.27100
  18. sell NEO for KCS at 1.27100

RGermain97 avatar Dec 23 '24 16:12 RGermain97

I'm looking into this

@ruidazeng I've also noticed this weird occurrence with the output, where it will print repetitive steps after a while.

New 10.87529% kucoin opportunity:

  1. buy TRX with KCS at 45.76240
  2. sell TRX for USDC at 0.24456

New 10.87529% kucoin opportunity:

  1. buy TRX with KCS at 45.76240
  2. sell TRX for USDC at 0.24456
  3. buy GMT with USDC at 7.62777
  4. sell GMT for USDT at 0.13370
  5. buy KAI with USDT at 362.31884
  6. sell KAI for BTC at 0.00000
  7. buy GMT with USDC at 7.62777
  8. sell GMT for USDT at 0.13370
  9. buy KAI with USDT at 362.31884
  10. sell KAI for BTC at 0.00000
  11. buy XDC with BTC at 1315789.47368
  12. sell XDC for ETH at 0.00002
  13. buy NEO with ETH at 235.62677
  14. buy XDC with BTC at 1315789.47368
  15. sell XDC for ETH at 0.00002
  16. buy NEO with ETH at 235.62677
  17. sell NEO for KCS at 1.27100
  18. sell NEO for KCS at 1.27100

I am looking into this.

ruidazeng avatar Dec 23 '24 17:12 ruidazeng

Hi just a concern, the exchange rate for atom/usdt is not 0.15446, its 6.45 at the current rate. The rest of the rates seem to be accurate.

New 65.5134% bitget opportunity:

  1. buy ATOM with USDT at 0.15446
  2. sell ATOM for BTC at 0.00007
  3. buy TRX with BTC at 390625.00000
  4. sell TRX for ETH at 0.00007
  5. buy LTC with ETH at 32.90556
  6. sell LTC for EUR at 96.58000
  7. buy ADA with EUR at 1.16863
  8. sell ADA for USDC at 0.89230
  9. buy DYDX with USDC at 1.13507
  10. sell DYDX for USDT at 1.44300

Can you double check the direction of the exchange rate on your end? Since 1/0.15446 = 6.45 and 1/6.45 = 0.15466.

It is strange that the rest of the rates are accurate.

ruidazeng avatar Dec 23 '24 17:12 ruidazeng

Hi just a concern, the exchange rate for atom/usdt is not 0.15446, its 6.45 at the current rate. The rest of the rates seem to be accurate. New 65.5134% bitget opportunity:

  1. buy ATOM with USDT at 0.15446
  2. sell ATOM for BTC at 0.00007
  3. buy TRX with BTC at 390625.00000
  4. sell TRX for ETH at 0.00007
  5. buy LTC with ETH at 32.90556
  6. sell LTC for EUR at 96.58000
  7. buy ADA with EUR at 1.16863
  8. sell ADA for USDC at 0.89230
  9. buy DYDX with USDC at 1.13507
  10. sell DYDX for USDT at 1.44300

Can you double check the direction of the exchange rate on your end? Since 1/0.15446 = 6.45 and 1/6.45 = 0.15466.

It is strange that the rest of the rates are accurate.

Ah yes, my apologies for the confusion.

RGermain97 avatar Dec 24 '24 16:12 RGermain97

@ruidazeng I've also noticed this weird occurrence with the output, where it will print repetitive steps after a while.

New 10.87529% kucoin opportunity:

  1. buy TRX with KCS at 45.76240
  2. sell TRX for USDC at 0.24456

New 10.87529% kucoin opportunity:

  1. buy TRX with KCS at 45.76240
  2. sell TRX for USDC at 0.24456
  3. buy GMT with USDC at 7.62777
  4. sell GMT for USDT at 0.13370
  5. buy KAI with USDT at 362.31884
  6. sell KAI for BTC at 0.00000
  7. buy GMT with USDC at 7.62777
  8. sell GMT for USDT at 0.13370
  9. buy KAI with USDT at 362.31884
  10. sell KAI for BTC at 0.00000
  11. buy XDC with BTC at 1315789.47368
  12. sell XDC for ETH at 0.00002
  13. buy NEO with ETH at 235.62677
  14. buy XDC with BTC at 1315789.47368
  15. sell XDC for ETH at 0.00002
  16. buy NEO with ETH at 235.62677
  17. sell NEO for KCS at 1.27100
  18. sell NEO for KCS at 1.27100

Can you make a new issue for this? I am not able to reproduce this error on kucoin (as of now). We might need to triage this. But I do see that it seems like 7-10 are steps that has repeated in your output.

ruidazeng avatar Dec 24 '24 17:12 ruidazeng

Hi just a concern, the exchange rate for atom/usdt is not 0.15446, its 6.45 at the current rate. The rest of the rates seem to be accurate. New 65.5134% bitget opportunity:

  1. buy ATOM with USDT at 0.15446
  2. sell ATOM for BTC at 0.00007
  3. buy TRX with BTC at 390625.00000
  4. sell TRX for ETH at 0.00007
  5. buy LTC with ETH at 32.90556
  6. sell LTC for EUR at 96.58000
  7. buy ADA with EUR at 1.16863
  8. sell ADA for USDC at 0.89230
  9. buy DYDX with USDC at 1.13507
  10. sell DYDX for USDT at 1.44300

Can you double check the direction of the exchange rate on your end? Since 1/0.15446 = 6.45 and 1/6.45 = 0.15466. It is strange that the rest of the rates are accurate.

Ah yes, my apologies for the confusion.

Great.

ruidazeng avatar Dec 24 '24 17:12 ruidazeng