The liquidity provider immediately receives the notification over WebSocket feed alerting them to the Assignment. The message takes this format:
{
"feed": "fills",
"username": "[email protected]",
"fills": [
{
"instrument": "PI_XBTUSD",
"time": 1581026151,
"price": 9292.5,
"seq": 103,
"buy": true,
"order_id": "87755b99-bfb7-4f51-a72b-70f542f793a5",
"fill_id": "89f0f4f9-66b5-45eb-ba3f-6eeb2da5cadd",
"fill_type": "assignee",
"qty": 184317
}
]
}
Additionally, the client may poll the REST API endpoint for fills to see:
{
"result": "success",
"fills": [
{
"fill_id": "89f0f4f9-66b5-45eb-ba3f-6eeb2da5cadd",
"symbol": "pi_xbtusd",
"side": "buy",
"order_id": "87755b99-bfb7-4f51-a72b-70f542f793a5",
"size": 184317,
"price": 9292.5,
"fillTime": "2020-02-06T21:55:51.000Z",
"fillType": "assignee"
}
...
]
}
The key fields in the responses are fill_type and fillType (for WebSocket and REST, respectively), which both take the value "assignee". This is the indication that should be used to programmatically handle the assignment.
Note:
- Set your preferences as you see fit on the Assignment Program section of the platform.
- You will not receive an Assignment that your available margin for the contract type can not handle.
The decimal and thousands separators shown in this article may differ from the formats displayed on our trading platforms. Review our article on how we use points and commas for more information.