View Source Hyperliquid.Api.Exchange.TwapOrder (hyperliquid v0.2.2)
Place a TWAP (Time-Weighted Average Price) order.
TWAP orders split large orders into smaller chunks executed over time.
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint
Summary
Functions
Place a TWAP order.
Functions
Place a TWAP order.
Parameters
private_key: Private key for signing (hex string)asset: Asset indexis_buy: true for buy, false for sellsz: Total sizeopts: Order options
Options
:reduce_only- Only reduce position (default: false):duration_minutes- Duration in minutes (default: 5):randomize- Randomize execution (default: false):vault_address- Trade for a vault
Returns
{:ok, response}- Order result{:error, term()}- Error details
Examples
{:ok, result} = TwapOrder.request(private_key, 0, true, "1.0", duration_minutes: 30)