Skip to main content
A market order executes immediately at the best available price Flash can route. It takes no price field; for a standard market order, maxSlippage bounds the final output against the amount quoted. QuickTrade uses maxPriceImpact instead because its output is not fixed at quote time. For the concepts behind these parameters, see Placing Orders. This page shows the full same-chain flow end to end (quote, sign, submit) as a runnable script for each chain. The EVM example buys WETH with USDC on Base; the Solana example buys WSOL with USDC.

Market parameters

Market orders do not accept a limit price (limitNotionalPrice or limitCrossPrice), expireTime, or triggers. The onchain deadline is set automatically (roughly 5 minutes from quote time).

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 (token approval on EVM, delegation on Solana) also need an RPC endpoint and the funder wallet’s key, supplied here through environment variables.

EVM

Buy WETH with 100 USDC on Base, with 5% slippage protection. If the spent token needs an allowance, the quote returns evm.approveTx (or evm.permitTypedData on the Permit2 path); submit or sign whichever it returns, then sign the order payload and submit.

SVM (Solana)

Buy WSOL with 100 USDC. 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.
To sell instead, set side to "sell" and denominate qty in the target asset (for example "0.05" to sell 0.05 WETH). Everything else stays the same.
To track the order after submit, poll GET /orders or stream live updates over the Orders WebSocket.

Crosschain Orders

Move funds across chains in one order.

Limit Order

Fill only at a set price or better.

Bracket Orders

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

Placing Orders

The full parameter reference for every order type.