This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ccxt | |
| from typing import List | |
| import itertools | |
| def is_valid_cycle(cycle: List[str]): | |
| """ | |
| Check if the given cycle of currency pairs forms a valid triangular arbitrage loop. | |
| """ | |
| # Split each currency pair into its individual currencies | |
| currencies = [pair.split('_') for pair in cycle] |