Binance Split Trading Symbol (Python)

Example

  • BTCUSDT = BTC, USDT
  • BTCETH = BTC, ETH

Base on Trading Rule, currently Binance only support the following quote asset class: BTC, ETH, BNB, USDT, PAX, TUSD, USDC

import resymbol = 'BTCUSDT'm = re.search(r'^(\w+)(BTC|ETH|BNB|USDT|PAX|TUSD|USDC|XRP|USDS)$', symbol)if m:    part1 = m.group(1)    part2 = m.group(2)    print(f"{part1}-{part2}")

NOTE: The static assets class is not reliable as Binance might add more or remove some. You might want to query /api/v1/exchangeInfo for an up to date list.

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.