Skip to main content

Swap Overview

Vulcx provides two ways to execute token swaps on Fogo. Both start with the same routing engine. The difference is how much control you want over the final transaction.

Swap lifecycle

Every swap follows the same three-phase pattern:
1

Get a quote

Call GET /api/v1/quote with the token pair, amount, and swap mode. The routing engine finds the best path across all supported DEXs and returns pricing, route details, and price impact.
2

Build the transaction

Choose one of two paths:
  • POST /api/v1/swap: Returns a complete unsigned transaction. Sign it and submit.
  • POST /api/v1/instructions: Returns raw instructions. Compose them into your own transaction with custom logic.
3

Sign and submit

Sign the transaction with the user’s wallet and submit it to the network. The on-chain program executes the swap atomically.

Which endpoint to use

Swap modes

Both modes support slippage protection. For ExactIn, the response includes minAmountOut (minimum you’ll receive). For ExactOut, it includes maxAmountIn (maximum you’ll spend).

Fogo capabilities

Supported tokens

Any SPL token with liquidity on a supported DEX can be swapped. The routing engine currently supports:
  • Valiant (concentrated liquidity)
  • Fluxbeam (AMM)
  • Moonit (bonding curves)
If a direct pool doesn’t exist, the engine routes through intermediate tokens (multi-hop).

Next steps

Get Quote

Understand quote parameters, response fields, and price impact.

Build Transaction

Build a ready-to-sign swap transaction.

Get Instructions

Get raw instructions for custom transaction composition.

Send Transaction

Sign, submit, and confirm the swap on-chain.
Last modified on August 31, 2026