In this article we walk through a situation where a trader on the MTF is liquidated and assigned, and the remaining open interest is unwound. We go through all the response examples that a participant will receive for this.
Let's assume that there is a user whose current positions are:
- LONG 2,920,000 Contracts on PI_ETHUSD
- LONG 400,000 Contracts on FI_ETHUSD_200625
Both these positions are using the main FI_ETHUSD margin account, which measures the risk in realtime, valuing the collateral vs position value, to determine whether to liquidate.
Once the margin account for the contract type is below the maintenance margin, liquidation occurs and the system sells those positions into the orderbook at the 0-equity imputed price for each contract.
In this case, the user's liquidation plays out as follows:
Position | Size | Amount Liquidated | Amount Assigned | Amount Unwound |
---|---|---|---|---|
PI_ETHUSD | 2,920,000 | 2,007,379 | 751,605 | 161,016 |
FI_ETHUSD_210625 | 400,000 | 0 | 0 | 0 |
This means the entire FI_ETHUSD_200625 position of 400,000 Contracts was successfully sold into the orderbook to new counterparties who had existing bids. The PI_ETHUSD position of 2,920,000 Contracts was able to liquidate 2,007,379 successfully into the orderbook and filled the remaining 751,605 contracts via the Position Assignment system.
As a result, the remaining 161,016 contracts will be unwound.
Below is an example notification for an Unwind of 10,000 Contracts to the unwound counterparty "satoshi@bitcoin.com". The unwind counterparty receives the following email (note that this format may change so do not rely on this formatting):
The unwound counterparty immediately receives the notification over WebSocket feed alerting them to the Assignment. The message takes this format:
{
"feed":"fills",
"username":"satoshi@bitcoin.com",
"fills":[
{
"instrument":"PI_ETHUSD",
"time":1623344903068,
"price":1647.0,
"seq":1,
"buy":false,
"qty":10000.0,
"order_id":"9bae454b-ec93-43f8-b31c-33d3881fe7ae",
"fill_id":"1298e9ed-4284-43b9-ab9e-0d93591efb36",
"fill_type":"unwindCounterparty",
"fee_paid":-0.00182149362,
"fee_currency":"ETH"
}
]
}
Additionally, the user may poll the REST API endpoint for fills to see:
{
"result":"success",
"fills":[
{
"fill_id":"1298e9ed-4284-43b9-ab9e-0d93591efb36",
"symbol":"pi_ethusd",
"side":"sell",
"order_id":"9bae454b-ec93-43f8-b31c-33d3881fe7ae",
"size":10000,
"price":1647,
"fillTime":"2021-06-10T17:08:23.068Z",
"fillType":"unwindCounterparty"
}
],
...
}
The key fields in the responses are fill_type and fillType (for WebSocket and REST, respectively), which both take the value "unwindCounterparty". This is the indication that should be used to programmatically handle the assignment.