tif field controls what happens when the order first reaches the order book. As of 2026-11-13, the documented encoded values are Gtc, Ioc, and Alo.
What each TIF value does
| Encoded value | Meaning | Behavior when the limit order first hits the book |
|---|---|---|
Gtc | Good til canceled | No special TIF behavior |
Ioc | Immediate or cancel | The unfilled part is canceled instead of resting |
Alo | Add liquidity only, also described as post only | The order is canceled instead of immediately matching |
Gtc when you do not want the order to be canceled by TIF at first hit. Use Ioc when you want any available liquidity to fill immediately and the remainder to be canceled. Use Alo when you want to add liquidity only and avoid immediate matching.
Source: Hyperliquid exchange endpoint documentation.
How tif is encoded in the order action
Orders are sent to POST https://api.hyperliquid.xyz/exchange with a JSON body. In the action.orders array, the order type is encoded in the t field. For a limit order, use:
"t": {
"limit": {
"tif": "Gtc"
}
}
Replace "Gtc" with "Ioc" or "Alo" as needed. The case matters: the documented encoded strings are Gtc, Ioc, and Alo.
A reference limit-order action body is:
{
"type": "order",
"orders": [
{
"a": 0,
"b": false,
"p": "1890.0",
"s": "0.02",
"r": false,
"t": {
"limit": {
"tif": "Alo"
}
},
"c": "0x1234567890abcdef1234567890abcdef"
}
]
}
Like what you're reading? Try it yourself โ this link supports ChartedTrader at no cost to you.
Join Hyperliquid and get a 4% fee discount on the first $25M of volume; Vaults and sub-accounts are excluded. โKey meanings from the documentation:
a: assetb:isBuyp: prices: sizer:reduceOnlyt: order typec: optional client order ID, orcloid, as a 128-bit hex string
nonce and signature. The Hyperliquid Python SDK can be used to generate signatures for exchange-endpoint requests. The examples above are reference request structures, not live test output.
Python-style action object
If you are building the request in Python, the order action can be represented as a dictionary before signing:
order_action = {
"type": "order",
"orders": [
{
"a": 0,
"b": False,
"p": "1890.0",
"s": "0.02",
"r": False,
"t": {
"limit": {
"tif": "Gtc"
}
},
"c": "0x1234567890abcdef1234567890abcdef"
}
]
}
This structure shows where tif belongs. The signed request body must still include the required nonce and signature fields.
Related guides
- Hyperliquid Order Types Explained
- Place Your First Hyperliquid Perp Trade Safely
- Hyperliquid API Error Responses: Troubleshooting Guide
Source
Affiliate disclosure
The Hyperliquid link below is a referral link. If you sign up, I may receive a trading-fee commission. The linked referral page lists a 4% fee discount for the first $25M of volume per account; Vaults and sub-accounts are excluded.
Join HyperliquidContinue with Hyperliquid
Browse the Hyperliquid guide hub for the complete user journey.