# twapOrder

## POST /exchange

> Place a TWAP order.

```json
{"openapi":"3.1.1","info":{"title":"Hyperliquid API - exchange/twapOrder","version":"1.0.0"},"tags":[{"name":"twapOrder"}],"servers":[{"url":"https://api.hyperliquid.xyz","description":"Mainnet"},{"url":"https://api.hyperliquid-testnet.xyz","description":"Testnet"}],"paths":{"/exchange":{"post":{"tags":["twapOrder"],"description":"Place a TWAP order.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"object","properties":{"type":{"description":"Type of action.","enum":["twapOrder"]},"twap":{"type":"object","properties":{"a":{"type":"integer","minimum":0,"description":"Asset ID."},"b":{"type":"boolean","description":"Position side (`true` for long, `false` for short)."},"s":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$","description":"Size (in base currency units)."},"r":{"type":"boolean","description":"Is reduce-only?"},"m":{"type":"integer","minimum":0,"description":"TWAP duration in minutes."},"t":{"type":"boolean","description":"Enable random order timing."}},"required":["a","b","s","r","m","t"],"description":"Twap parameters."}},"required":["type","twap"],"description":"Action to perform."},"nonce":{"type":"integer","minimum":0,"description":"Nonce (timestamp in ms) used to prevent replay attacks."},"signature":{"type":"object","properties":{"r":{"type":"string","pattern":"^0[xX][0-9a-fA-F]+$","minLength":66,"maxLength":66,"description":"First 32-byte component."},"s":{"type":"string","pattern":"^0[xX][0-9a-fA-F]+$","minLength":66,"maxLength":66,"description":"Second 32-byte component."},"v":{"enum":[27,28],"description":"Recovery identifier."}},"required":["r","s","v"],"description":"ECDSA signature components."},"vaultAddress":{"type":"string","pattern":"^0[xX][0-9a-fA-F]+$","minLength":42,"maxLength":42,"description":"Vault address (for vault trading)."},"expiresAfter":{"type":"integer","minimum":0,"description":"Expiration time of the action."}},"required":["action","nonce","signature"],"description":"Place a TWAP order."}}},"required":true},"responses":{"200":{"description":"Response for creating a TWAP order.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"description":"Successful status.","enum":["ok"]},"response":{"type":"object","properties":{"type":{"description":"Type of response.","enum":["twapOrder"]},"data":{"type":"object","properties":{"status":{"anyOf":[{"type":"object","properties":{"running":{"type":"object","properties":{"twapId":{"type":"integer","minimum":0,"description":"TWAP ID."}},"required":["twapId"],"description":"Running order status."}},"required":["running"]},{"type":"object","properties":{"error":{"type":"string","description":"Error message."}},"required":["error"]}],"description":"Status of the operation or error message."}},"required":["status"],"description":"Specific data."}},"required":["type","data"],"description":"Response details."}},"required":["status","response"],"description":"Response for creating a TWAP order."}}}},"422":{"description":"Failed to deserialize the JSON body into the target type","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```
