StephanAkkerman / fintwit-bot

FinTwit-Bot is a Discord bot designed to track and analyze financial markets by pulling data from platforms like Twitter, Reddit, and Binance. It features customizable tools for sentiment analysis, market trends, and portfolio tracking to help traders stay informed and make data-driven decisions.
http://akkerman.ai/fintwit-bot/
MIT License
67 stars 15 forks source link

Change liquidations API #499

Closed StephanAkkerman closed 4 months ago

StephanAkkerman commented 8 months ago

Coinglass removed their free API 👎 Now we will use Binance instead, because we are not paying 💸

StephanAkkerman commented 8 months ago

https://binance-docs.github.io/apidocs/futures/en/#liquidation-order-streams

StephanAkkerman commented 8 months ago

image Websocket only it seems

StephanAkkerman commented 8 months ago

Example code:

#!/usr/bin/env python3

import websocket

def on_message(ws, msg):
    print(msg)

def on_close():
    print("closed")

socket = "wss://fstream.binance.com/ws/!forceOrder@arr"
ws = websocket.WebSocketApp(socket, on_message=on_message, on_close=on_close)
ws.run_forever()
StephanAkkerman commented 7 months ago

disabled from config for now

StephanAkkerman commented 7 months ago

Preferably we use a method for getting all the data at once instead of a websocket

StephanAkkerman commented 5 months ago

image image for reference

StephanAkkerman commented 4 months ago

Could maybe scrape: https://coinalyze.net/bitcoin/liquidations/ but seems hard

StephanAkkerman commented 4 months ago

Could use https://github.com/aoki-h-jp/binance-bulk-downloader for historical liquidation data of daily bitcoin only and make it a separate repo

StephanAkkerman commented 4 months ago

Or can download it from: https://data.binance.vision/?prefix=data/futures/cm/daily/liquidationSnapshot/BTCUSD_PERP/

StephanAkkerman commented 4 months ago

image coinglass uses 6 months of data, not clear if only cm / um data or both

StephanAkkerman commented 4 months ago

There seems to be something wrong with the liquidation data of BTCUSD_PERP...

StephanAkkerman commented 4 months ago

Implemented in https://github.com/StephanAkkerman/liquidations-chart