Time in Force (TIF)
Time In Force (TIF) orders expire after a set amount of seconds. This provides security and confidence to market makers that stale or mispriced orders will not remain on the order book in the event of network degradation or any other issue.
PerpPlaceOrder accepts an expiryTimestamp input which cancels an order after "n" seconds if it has not been executed.
The time on the validator is used to determine if a TIF order has expired.
When retrieving the current cluster time, be sure to use the "Processed" commitment level.
Solana Explorer reports the cluster time using the "Finalized" commitment level, which is slightly different.
Retrieving the Cluster Time
You can retrieve the current cluster time by using the getBlockTime endpoint.
https://docs.solana.com/developing/clients/jsonrpc-api#getblocktime
Last updated