Skip to main content
POST
Build a market (swap) order

Authorizations

X-API-Key
string
header
required

Body

application/json
market
string
required

Base58-encoded market address.

Example:

"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4"

maxSlippageBps
integer
required

Maximum allowed slippage in basis points.

Required range: x >= 0
side
enum<string>
required

Trade side.

Available options:
buy,
sell
size
string
required

Amount to trade (decimal string). Interpretation depends on swapMode.

accountOwner
string | null

The wallet that owns the ArcherAccount this request acts through. With platform it derives the account PDA server-side — you never handle a PDA. Omit for a plain wallet-owned book. Replaces the earlier archerAccount field, which is no longer read.

platform
enum<string> | null
default:self

Platform namespace for accountOwner. Ignored unless accountOwner is set.

Available options:
self,
treadfi
preflight
boolean | null
default:false

Simulate the built transaction before returning it, and reject with the program's reason if it would fail (insufficient balance, slippage, liquidity gone, unauthorised signer). Off by default: a transaction is otherwise returned whether or not the signer could land it right now, which callers that build at quote time rely on. Ignored without signer.

priorityFeeMicroLamports
integer<int64>

Priority fee for the transaction's compute-budget instruction, in micro-lamports per compute unit. Omitted → the server default.

Example:

50000

signer
string

The wallet that signs the swap: the taker, or with accountOwner the account's owner or delegate. Omit for a quote only: the response then carries quoteResponse and no transaction, and the caller's own maker books (if any) cannot be excluded from the quote. Existing clients may keep sending it as takerAddress; send one name only.

swapMode
enum<string>

Controls how size is interpreted. When omitted, size is in base tokens.

Available options:
MaxAmountIn,
MinAmountOut
withInstructions
boolean | null
default:false

Also return the unsigned instructions under instructions, for composing your own transaction instead of signing ours. Omitted or false leaves the response exactly as it was.

Response

Unsigned swap transaction.

Legacy body of the deprecated POST /v1/orders/build and POST /v1/order/market, unchanged from what production has always served. orderType is always "market" and intentId always null — async execution is gone, every order is a sync swap. Same engine and same transaction as POST /v1/order/swap, which returns the cleaner BuildOrderResponse.

addressLookupTables
string[]
required

Always empty; none configured.

availableSize
string
required

Base size the book could fill.

estimatedBaseSize
string
required

Base tokens that would trade.

estimatedFee
string
required

Protocol fee, in quote tokens.

estimatedPrice
string
required

Average execution price.

estimatedQuoteSize
string
required

Quote tokens that would trade, before fees.

estimatedTotal
string
required

Quote tokens paid or received, fees included.

expiresAt
integer<int64>
required

Blockhash expiry (unix seconds).

fullyFilled
boolean
required

Always true; a short book is refused, not partially built.

makerBooksUsed
integer<int32>
required

Maker books the transaction attached.

orderType
string
required

Always "market". Vestigial.

swapMode
string
required

Resolved swap mode: MaxAmountIn or MinAmountOut.

transaction
string
required

Base64 unsigned VersionedTransaction.

worstPrice
string
required

Price of the last level consumed.

intentId
string | null

Always null. Vestigial.