INNER CODE UNIT · Python

size_matches

hadialaddin/crypto-genie · crypto-genie.py:174

    size_matches = size1 == size2 or math.floor(size1 * 10)/10.0 == size2 or math.floor(size1 * 100)/100.0 == size2 or math.floor(size1 * 1000)/1000.0 == size2 or math.floor(size1 * 10000)/10000.0 == size2
    return price_matches and size_matches

def round_to_tick(price,tick_size):
    decimals_count = str(tick_size)[::-1].find('.') # Tick Size number of decimals
    return round(round(float(price)/float(tick_size))*float(tick_size), decimals_count)


###### ByBit Base Endpoints (only edit if they don't match the currently published ones by ByBit at: https://bybit-exchange.github.io/docs/linear/#t-websocket
wsURL_USDT_mainnet = "wss://stream.bybit.com/realtime_private"
wsURL_USDT_testnet = "wss://stream-testnet.bybit.com/realtime_private"
wsURL_Inverse_mainnet = "wss://stream.bybit.com/realtime"
wsURL_Inverse_testnet = "wss://stream-testnet.bybit.com/realtime"
sessionURL_mainnet = "https://api.bybit.com"
sessionURL_testnet = "https://api-testnet.bybit.com"
######

if network == 'testnet':

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…