Skip to content
Alchemy Logo

Get Order

GET
https://solana-mainnet.g.alchemy.com/v2/{apiKey}/swap/v2/order

Returns a swap quote for inputMint → outputMint.

Path Parameters

stringrequireddefaults to docs-demo

For higher throughput, create your own API key.

Query Parameters

stringrequired

Mint address of the input token.

stringrequired

Mint address of the output token.

stringrequired

Amount to swap in the smallest unit of the input token (lamports for native SOL, base units for SPL tokens). Refers to the input token by default, or to the output token when swapMode is ExactOut.

stringoptional

Public key of the wallet that will sign the transaction. When omitted, the response returns a quote only and transaction is null.

stringoptional

Wallet to receive the output instead of taker (omit to keep it with taker). Expects a wallet address, not a token account. Missing ATAs are created automatically.

stringoptional

How amount is interpreted.

Allowed values:

integeroptionaldefaults to 50

Slippage tolerance in basis points, 0–10000.

rtse (automatic slippage) is not supported.

integeroptional

Custom priority fee, in lamports. Only used when broadcastFeeType is set; otherwise ignored and the fee is estimated automatically. Added to jitoTipLamports (if set) to form the fee total that broadcastFeeType applies.

integeroptional

Custom Jito tip, in lamports (minimum 1000). Only used when broadcastFeeType is set; otherwise ignored and the fee is estimated automatically. Added to priorityFeeLamports (if set) to form the fee total that broadcastFeeType applies.

stringoptional

How your custom fee (priorityFeeLamports + jitoTipLamports) is applied.

When omitted, or sent without priorityFeeLamports or jitoTipLamports, the fee is estimated automatically.

Allowed values:

stringoptional

Comma-separated list of DEX labels to exclude from routing. Labels are case-sensitive (for example, Raydium,Orca+V2,Meteora+DLMM).

stringoptional

Not supported yet; routing uses only metis, so excluding it returns an error.

stringoptional

Wallet that pays transaction costs (fees, Jito tip, token-account rent) for taker; the taker still signs and pays the trade amount. Any public key can be used; no effect if equal to taker. See errorCode for funding failures. Does not change mode.

integeroptional

Integrator fee in basis points (50–255). Must be sent with referralAccount.

stringoptional

Referral account in the referral program. Must be sent with referralFee. The fee is charged in the output token on ExactIn and in the input token on ExactOut, and is paid into that mint’s fee token account under this referral account. That account must already exist.

Responses

200

Quote, plus an unsigned transaction when a funded taker is supplied. Insufficient funding returns 200 with an empty transaction and error fields.

Was this page helpful?