I earned $6 within 5 seconds. The price increased in 30% within less than a second, so the orders squeezed and executed at better prices:

I earned $6 within 5 seconds. The price increased in 30% within less than a second, so the orders squeezed and executed at better prices:
Hourly interest has grown in 100 times (2.28310500 / 0.02283100):
so my hourly interest fee = 717.95000000 * 2.28310500 / 100 * 1.5 = 24.5 USDT
(more…)I earned $6.29, see 5 min chart:
and paid $5.95 as interest fee, so the profit is $0.34. Details:
(more…)
from pybit.unified_trading import WebSocket
from pybit.unified_trading import HTTP
from time import sleep
session = HTTP(testnet=False)
info = session.get_instruments_info(category="spot")
symbol_infos = info["result"]["list"]
websockets = []
def handle_message(message):
print(message)
def subscribe(websockets, symbols):
print(f'Subscribing to {symbols}')
ws = WebSocket(
testnet=False,
channel_type="spot",
)
ws.trade_stream(symbol=symbols, callback=handle_message)
websockets += [ws]
Spot is limited to 10 symbols:
from pybit.unified_trading import WebSocket
from time import sleep
ws = WebSocket(
testnet=True,
channel_type="spot",
)
def handle_message(message):
print(message)
#ws.orderbook_stream(50, "BTCUSDT", handle_message)
ws.ticker_stream(symbol=["BTCUSDT", "ETHUSDT"], callback=handle_message)
while True:
sleep(1)