Skip to main content
A limit order fills only at your limit price or better. A buy fills at or below the limit; a sell fills at or above it. Price it in either basis: limitNotionalPrice, the USD price of the target asset, or limitCrossPrice, the pair rate (target / contra). For the concepts behind the parameters, see Placing Orders. This page shows the full flow end to end (quote, sign, submit) as a runnable script for each chain. The EVM example places a buy limit for WETH against USDC on Base; the Solana example does the same for WSOL against USDC. The signing and submit plumbing is identical to a market order; only the request fields differ.

Limit parameters

A limit order requires exactly one of limitNotionalPrice or limitCrossPrice; sending both is rejected. Limit orders do not accept triggers.

End-to-end example

Prerequisites. EVM examples use viem; Solana examples use @solana/web3.js, tweetnacl, and bs58. All requests go to https://flash.definitive.fi/v1 with your key in the x-definitive-api-key header. The public integrator key dpka_513a2bd7_57a2_46d2_927b_2a3857fe271b is safe for development. The onchain steps also need an RPC endpoint and the funder wallet’s key, supplied here through environment variables.

EVM

Buy WETH with up to 100 USDC, only when WETH is available at $1,000 per WETH or lower. If the spent token needs an allowance, the quote returns evm.approveTx (or evm.permitTypedData on the Permit2 path); handle whichever it returns, then sign the order payload and submit.

SVM (Solana)

Buy WSOL with up to 100 USDC, only when WSOL is available at $150 per WSOL or lower. Before the first trade of a token the swap needs the funder’s token accounts (svm.ataSetupIxs) and a delegation (svm.delegateIx or a sponsor-paid svm.sponsoredDelegateTx). Run the onchain steps in order, then sign the order message offchain and submit.
For a sell limit, set side to "sell", denominate qty in the target asset (for example "0.05" WETH), and read the limit price as the floor: the order fills at or above that price. To price against the pair instead of the dollar, swap limitNotionalPrice for limitCrossPrice — limitCrossPrice: "1000" on the EVM example above is 1,000 USDC per WETH. Add expireTime (an ISO-8601 timestamp) to make the order expire; omit it for good-til-cancelled.
To track the order after submit, poll GET /orders or stream live updates over the Orders WebSocket.

TWAP Order

Slice a large order into tranches over a duration.

Trigger Orders

Stop, stop-loss, and take-profit orders.

Bracket Orders

Attach a take-profit / stop-loss pair to this order at placement.