Skip to content

Instantly share code, notes, and snippets.

@melardev
Created November 21, 2024 19:19
Show Gist options
  • Select an option

  • Save melardev/c60bee2dd57b55946dd7532a7318bc43 to your computer and use it in GitHub Desktop.

Select an option

Save melardev/c60bee2dd57b55946dd7532a7318bc43 to your computer and use it in GitHub Desktop.
import ccxt
client = ccxt.mexc()
client.load_markets(params={
'type': 'swap'
})
added = set()
with open('mexc_futures_pairs.txt', 'w') as fd:
for market_key, market_info in client.markets.items():
if market_info["quote"] != 'USDT':
continue
if not market_info['swap'] and not market_info['future']:
continue
ms = f'MEXC:{market_info["base"]}{market_info["quote"]}.P'
if ms in added:
continue
added.add(ms)
fd.write(ms + '\n')
print(ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment