Instrument Expiry
Overview
The engine supports both immediate and scheduled expiry of instruments, automatically closing out positions and canceling active orders when the expiry time is reached. This mechanism supports both normal settlement of term futures, and early settlement of perpetual swaps and term futures.
What Happens at Expiry
At expiry:
- Every order on the instrument receives rejection reason
InstrumentExpired. Any positions on the instrument are closed at the expiry price. - The instrument state changes from
LivetoExpired. The expiry time is stored and returned on future queries.
Scheduled expiry
If an expiryTime is specified when expiring an instrument, the engine will wait until that time to perform the expiry.
- The instrument's lifecycle state remains
Liveuntil the expiry time is reached - All queries and subscriptions return the expiry time that was set, so clients know when the instrument will expire
- The engine will perform expiry once the expiry time is reached
If an instrument already has a pending scheduled expiry and expiry is triggered again:
- If
expiryTimeis specified, the expiry time is updated to the new time - If
expiryTimeis not specified, the instrument is expired immediately
Expiry price
If no price is specified on an instrument expiry request, the engine will use the current price of the instrument (either the mark price, or the last traded price, depending on the instrument's MarkMethod). The exchange is checked for mark price cap before expiry occurs:
Validation
- Attempting to expire an expired instrument is rejected
- Attempting to schedule expiry in the past is rejected (expiry does not happen immediately)
- Attempting to schedule expiry with a fixed price is rejected