bmoscon / cryptofeed

Cryptocurrency Exchange Websocket Data Feed Handler
Other
2.14k stars 668 forks source link

Liquidations for OKEX #612

Open bmoscon opened 2 years ago

bmoscon commented 2 years ago

Currently okex only supports liquidations for perpetual swaps, need to add support for futures and options

nirvana-msu commented 2 years ago

@bmoscon actually at the moment liquidations are not working for perpetual swaps either. It used to be supported, but that got broken during API v5 migration: https://github.com/bmoscon/cryptofeed/commit/eaa49906a66cf9a3f84eb1503747578f2f7e8ee1#diff-0f1c8fea8c071c11fe101704ca24534b5388ac2090b6727a0959441690d986ffL97-L98

There's still a lot of code in _liquidation callback, but it is never called (no task created anymore): https://github.com/bmoscon/cryptofeed/blob/5ecbb6cfabe837581ca4233dfed8f91c9ec15da7/cryptofeed/exchanges/okex.py#L132-L133

Would be good to get it back working, at least for perpetual swaps.

Also, that code in callback is likely broken - e.g. there is id positional argument missing here, between price and status: https://github.com/bmoscon/cryptofeed/blob/5ecbb6cfabe837581ca4233dfed8f91c9ec15da7/cryptofeed/exchanges/okex.py#L118-L119

Nootski commented 2 years ago

Currently okex only supports liquidations for perpetual swaps, need to add support for futures and options

Unfortunately perp swaps liquidations return an error :

ERROR : OKEX: Error: {'event': 'error', 'msg': "channel:liquidations,instId:ETH-USDT-SWAP doesn't exist", 'code': '60018'}