Skip to main content
Function:
ABI Object:
Parameters:
  • signer - The account signer
  • subaccount - The Trading Account object
  • market - The PerpMarket object
  • size - Total size to execute (u64)
  • is_buy - True for buy, false for sell
  • is_reduce_only - Whether order can only reduce position
  • client_order_id - Optional client-assigned order ID `<Option<String>>`
  • twap_frequency_seconds - How often to execute sub-orders (u64)
  • twap_duration_seconds - Total duration for TWAP order (u64)
  • builder_address - Optional builder address `<Option<address>>`
  • builder_fees - Optional builder fee `<Option<u64>>`, in units of 0.0001% (basis points × 100; e.g. 1000 = 10 bps = 0.1%, the protocol maximum). The TypeScript SDK takes basis points and does this conversion for you

Constraints

The transaction aborts unless all of the following hold:
  • twap_duration_seconds is between 120 and 86400 (2 minutes to 24 hours)
  • twap_frequency_seconds is at least 60
  • Duration is at least one frequency interval and an exact multiple of the frequency
  • Each slice, size / (duration / frequency + 1), is at least the market’s min_size
Example: