Created
March 2, 2022 10:34
-
-
Save Lakshmi-1212/3fc21bde164d24c20198fa5c54606405 to your computer and use it in GitHub Desktop.
This file contains 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
def get_crypto_combinations(market_symbols, base): | |
combinations = [] | |
for sym1 in market_symbols: | |
sym1_token1 = sym1.split('/')[0] | |
sym1_token2 = sym1.split('/')[1] | |
if (sym1_token2 == base): | |
for sym2 in market_symbols: | |
sym2_token1 = sym2.split('/')[0] | |
sym2_token2 = sym2.split('/')[1] | |
if (sym1_token1 == sym2_token2): | |
for sym3 in market_symbols: | |
sym3_token1 = sym3.split('/')[0] | |
sym3_token2 = sym3.split('/')[1] | |
if((sym2_token1 == sym3_token1) and (sym3_token2 == sym1_token2)): | |
combination = { | |
'base':sym1_token2, | |
'intermediate':sym1_token1, | |
'ticker':sym2_token1, | |
} | |
combinations.append(combination) | |
return combinations | |
wx_combinations_usdt = get_crypto_combinations(market_symbols,'USDT') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment