Trade API

Quote and transaction-building endpoints for routed swaps.

Get swap quote

get

Get a routed swap quote for an exact input amount.

Query parameters
inputMintstringRequired

Token mint address to swap from.

outputMintstringRequired

Token mint address to swap to.

amountstringRequired

Amount in base units, such as token decimals or lamports for SOL.

slippageBpsnumberRequired

Slippage tolerance in basis points. For example, 50 = 0.5%.

txVersionstring · enumRequired

Transaction version.

Possible values:
Responses
chevron-right
200

Successful quote response.

application/json
idstringOptional
successbooleanOptional
versionstringOptional
get
/compute/swap-base-in
200

Successful quote response.

Enter swap

post

Build one or more serialized swap transactions from a quote response.

Body
swapResponseobjectRequired

Response returned by the quote endpoint.

walletstringRequired

User wallet public key.

txVersionstring · enumRequired

Transaction version.

Possible values:
wrapSolbooleanOptional

Wrap SOL to wSOL for the input leg.

unwrapSolbooleanOptional

Unwrap wSOL to SOL for the output leg.

inputAccountstringOptional

Input token account. Omit if the input is SOL.

outputAccountstringOptional

Output token account. Omit if the output is SOL.

computeUnitPriceMicroLamportsstringOptional

Priority fee in micro-lamports.

Responses
chevron-right
200

Successful transaction build response.

application/json
idstringOptional
versionstringOptional
successbooleanOptional
post
/transaction/swap-base-in
200

Successful transaction build response.

Last updated

Was this helpful?