Liquidation RFQ
Channel Update Frequency: real-time, whenever there is an upcoming liquidation.
The liquidation RFQ (request for quotes) channel publishes a message 500ms before a liquidation event is due to occur. A liquidation event can be classed as one of the following:-
liquidation of a clients perp position (in the perp books)
liquidation of a clients spot collateral (in the spot books)
The message will contain the market code and is designed to give liquidity providers and traders an opportunity to make a 2-way market for the upcoming liquidation event.
Curl
Request format
{
"op": "subscribe",
"tag": 1,
"args": ["liquidationRFQ"]
}Success response format
{
"event": "subscribe",
"channel": "liquidationRFQ",
"success": True,
"tag": "1",
"timestamp": "1613774604469"
}Channel update format
{
"table": "liquidationRFQ",
"data": [ {
"marketCode": "BTC-USD-SWAP-LIN"
"timestamp": "1613774607889"
} ]
}Python
Request format
import websockets
import asyncio
import json
liquidation = \
{
"op": "subscribe",
"tag": 1,
"args": ["liquidationRFQ"]
}
url= 'wss://api.ox.fun/v2/websocket'
async def subscribe():
async with websockets.connect(url) as ws:
while True:
if not ws.open:
print("websocket disconnected")
ws = await websockets.connect(url)
response = await ws.recv()
data = json.loads(response)
print(data)
if 'nonce' in data:
await ws.send(json.dumps(liquidation))
elif 'success' in data and data['success'] == 'True':
continue
asyncio.get_event_loop().run_until_complete(subscribe())Request Parameters
op
STRING
Yes
subscribe
tag
INTEGER or STRING
No
If given it will be echoed in the reply and the max size of tag is 32
args
Single element LIST
Yes
liquidationRFQ
Channel Update Fields
table
STRING
liquidationRFQ
data
LIST of dictionary
marketCode
STRING
Market code of liquidation
timestamp
STRING
Millisecond timestamp
Market
Last updated