Skip to main content
Creating an order in V2 is a two-step process: craft and sign a deposit transaction, then submit it alongside your order parameters.
Action required: This change is planned for Thursday, May 14, 2026 at 4:00 AM UTC / 12:00 PM SGT. Price-order deposits crafted with POST /trigger/v2/deposit/craft must include orderType: "price" and orderSubType. Requests missing either field will return a 4xx.
For a working reference of the full order creation flow, see how jup.ag handles it. The frontend implements the same API with validation, error handling, and UX patterns you can use as a guide.

Prerequisites

Signing deposit transactions requires @solana/web3.js:

End-to-End Flow

Step 1: Get Your Vault

Retrieve your vault, or register one if this is your first time. The vault is a Privy-managed custodial account that holds deposits for your orders.

Step 2: Craft a Deposit Transaction

The deposit endpoint builds an unsigned transaction that transfers tokens from your wallet to your vault.
Set orderSubType to match the price order you will create: Response:
The vault address is automatically resolved from your JWT. You do not specify it in the request. You also do not pass inputTokenAccount or outputTokenAccount into POST /trigger/v2/orders/price; the API stores those accounts against the deposit requestId.
For orderSubType: "otoco", the response also includes outputTokenAccount for the output token account used by the conditional OCO pair.

Step 3: Sign the Deposit Transaction

Step 4: Create the Order

Submit the signed deposit alongside your order parameters. The order type determines which fields are required.

Single Order (Limit)

A single order triggers when the price of triggerMint crosses above or below the target price.

OCO Order (One-Cancels-Other)

An OCO order creates a take-profit and stop-loss pair sharing one deposit. When one side fills, the other cancels automatically.
The take-profit price must be greater than the stop-loss price.

OTOCO Order (One-Triggers-One-Cancels-Other)

An OTOCO order has a parent trigger that executes first. Once filled, it automatically activates a TP/SL pair (OCO) on the output tokens.

Order Parameters Reference

Common Fields (All Order Types)

Single Order Fields

OCO Order Fields

OTOCO Order Fields

Default Slippage

If slippage is not specified, defaults vary by order type and trigger condition: Stop-loss orders use a higher default because execution certainty is more important than price precision when cutting losses.

Validation Rules

  • Minimum order size: 10 USD
  • Input and output mints must be different
  • Slippage: 0-10000 basis points
  • expiresAt is required and must be a future timestamp (milliseconds)
  • OCO/OTOCO: take-profit price must be greater than stop-loss price
Unlike V1 where orders could exist indefinitely, V2 requires an expiration on every order. Adding a TTL allows the system to prune orders that are unlikely to fill, improving execution quality for active orders. For long-lived orders, use a far-future timestamp (e.g. 30 days).

Response

The txSignature confirms the deposit transaction landed on-chain. The order is now active and will execute when price conditions are met.