Drakkar-Software / Triangular-Arbitrage

Crypto triangular arbitrage by OctoBot
https://www.octobot.cloud/tools/triangular-arbitrage?utm_source=github&utm_medium=dk&utm_campaign=free_tools&utm_content=repo_link
GNU Affero General Public License v3.0
41 stars 13 forks source link

Modified main.py display #15

Closed ruidazeng closed 1 week ago

ruidazeng commented 1 week ago

Modified detector.py such that the detection algorithm works for any cycle, not just triangular. This might be more practical for arbitrage opportunities.

Herklos commented 1 week ago

Can you please fix the tests? They are not passing anymore image

ruidazeng commented 1 week ago

I see. I just reverted cycle_detectorfor now, the only changes at the moment are in main.py and README.md

The cycle_detector code returned a cycle of 4 for the example test given, which is the best arbitrage opportunity with the best rates overall, an insanely profitable opportunity from USDT >> ETH >> BTC >> USDC >> USDT at 477.5%, which is a cycle that cannot be found by the triangular detector, so it failed the check that restricts the best opportunity cycle to 3:

-------------------------------------------
New 477.5% binance opportunity:
1. BUY USDT to ETH at 0.00050
2. SELL ETH to BTC at 0.30000
3. SELL BTC to USDC at 35000.00000
4. SELL USDC to USDT at 1.10000
-------------------------------------------

I have reverted my code for cycle_detector (at the moment) since this will never pass the test as the test only accepts triangular (3) arbitrage opportunities.

Herklos commented 1 week ago

I see. I just reverted cycle_detectorfor now, the only changes at the moment are in main.py and README.md

The cycle_detector code returned a cycle of 4 for the example test given, which is the best arbitrage opportunity with the best rates overall, an insanely profitable opportunity from USDT >> ETH >> BTC >> USDC >> USDT at 477.5%, which is a cycle that cannot be found by the triangular detector, so it failed the check that restricts the best opportunity cycle to 3:

-------------------------------------------
New 477.5% binance opportunity:
1. BUY USDT to ETH at 0.00050
2. SELL ETH to BTC at 0.30000
3. SELL BTC to USDC at 35000.00000
4. SELL USDC to USDT at 1.10000
-------------------------------------------

I have reverted my code for cycle_detector (at the moment) since this will never pass the test as the test only accepts triangular (3) arbitrage opportunities.

I see, thank for these details. It would be an interesting feature to add. The tests are really simple, you may succeed in fixing them in just a few minutes I think.

ruidazeng commented 1 week ago

@Herklos The tests are passing now, will this be approved for merge?

Herklos commented 1 week ago

I would have liked you to add the management of high order cycles & adapt the tests for it.

Concerning the current changes, I don't really see the added value of your modifications.