Skip to content

Instantly share code, notes, and snippets.

@ugik
Created June 9, 2021 11:36
Show Gist options
  • Select an option

  • Save ugik/4b7d689f1964decb6d26edd60d74f3c4 to your computer and use it in GitHub Desktop.

Select an option

Save ugik/4b7d689f1964decb6d26edd60d74f3c4 to your computer and use it in GitHub Desktop.
def find_triangles(prices):
triangles = []
starting_coin = 'USDT'
for triangle in recurse_triangle(prices, starting_coin, starting_coin):
coins = set(triangle['coins'])
if not any(prev_triangle == coins for prev_triangle in triangles):
yield triangle
triangles.append(coins)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment