↔️Swap API

The FluxBeam Swap API allows developers and users to retrieve swap quotes and pre-built transactions to speed up integration.

Quote

The quote API will return the expected output amount and slippage amount based on the provided input amount & token mints.

Currently, the API only returns pools on FluxBeam DEX.

Get a quote for a token swap

get
Query parameters
inputMintstringRequired

Source token

outputMintstringRequired

Destination token

amountintegerRequired

Source token input amount

slippageBpsintegerOptional

Slippage in BPS

Responses
200

Returns a swap quote

application/json
get
/v1/quote
200

Returns a swap quote

Example

Swap Transaction

The Transaction endpoint returns a pre-built transaction that is ready to be signed by the payer wallet based on the quote provided.

The swap transaction includes the following instructions:

  • Priority Fee Price & Units

  • Input & Output associated token account creation

  • Wrap & Unwrap of SOL accounts

Returns the swap transaction for the provided quote

post
Body
priorityFeeLamportsintegerOptionalExample: 100
userPublicKeystringOptionalExample: {PAYER_WALLET_ADDRESS}
wrapAndUnwrapSolbooleanOptionalExample: true
Responses
200

Returns a swap quote

application/json
post
/v1/swap/transaction
200

Returns a swap quote

Example

Swap Instruction

The instruction endpoint will return the FluxBeam swap instruction for a given quote. The instruction should be included within a transaction that handles the priority fee & associated token account calls.

Returns a swap instruction for the provided quote

post

If no pool is provided a quote will be generated.

Body
priorityFeeLamportsintegerOptionalExample: 100
userPublicKeystringOptionalExample: {PAYER_WALLET_ADDRESS}
wrapAndUnwrapSolbooleanOptionalExample: true
Responses
200

Returns a swap instruction to be added to transaction

application/json
post
/v1/swap/instruction
200

Returns a swap instruction to be added to transaction

Example

Last updated