Skip to content

Instantly share code, notes, and snippets.

import ccxt
exchange = 'mexc'
if exchange == 'binance':
client = ccxt.binance()
elif exchange == 'coinbase':
client = ccxt.coinbase()
elif exchange == 'bitfinex':
client = ccxt.bitfinex()
elif exchange == 'okx':
import time
import requests
from web3 import Web3
infura_url = 'https://eth.llamarpc.com'
web3 = Web3(Web3.HTTPProvider(infura_url))
bitquery_api = '<bitquery_api>'
api_url = "https://graphql.bitquery.io/"
import asyncio
import datetime
import json
import sys
import time
import pytz
from autobahn.asyncio.websocket import WebSocketClientFactory, WebSocketClientProtocol
if len(sys.argv) > 1 and sys.argv[1].lower() == 'spot':
"""
This script gets all Binance futures tickers, it tries to match the spot tickers against the
futures tickers.
The resulted TradingView list consists of ALL futures + their spot equivalents,
any other spot ticker (like $PYR) is not included.
This is useful for:
- Quickly highlight spot/futures premium, price difference
- Quickly switch from spot to futures chart to spot differences, for instance if futures had a massive wick that does not exist
in spot, then you may no longer be interested in the setup anymore as it is not clear to define when the liquidity is swept or not.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
How to pop a message box without blocking the script. It's running in the background, so it may not be in best practices
but it works which is what I wanted.
"""
import threading
import time
import tkinter as tk
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.