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
// Javascript to run in a dev console | |
// to see the value of the tokens | |
// I use this to get the value of the tokens dispersed in a presale | |
const elements = document.querySelectorAll('span.text-muted'); | |
let total = 0; | |
function parseValue(str) { | |
// Remove commas and the dollar sign | |
let cleanedStr = str.replace(/[,()$]/g, ''); |
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
import {clusterApiUrl, Connection, LAMPORTS_PER_SOL, PublicKey} from "@solana/web3.js"; | |
// const connection = new Connection("https://api.mainnet-beta.solana.com", 'confirmed'); | |
const connection = new Connection(clusterApiUrl("mainnet-beta")); | |
async function getAccountBalance(publicKey: PublicKey) { | |
const balanceInLamports = await connection.getBalance(publicKey); | |
const balanceInSOL = balanceInLamports / LAMPORTS_PER_SOL; | |
return balanceInSOL; |
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
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': |
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
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/" |
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
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 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
""" | |
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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
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 |
NewerOlder