Skip to main content

Swap Overview

Argyros 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

ScenarioEndpointWhy
Standard swap integrationPOST /swapSimplest path. You get a ready-to-sign transaction.
Custom transaction logicPOST /instructionsYou need to add instructions before/after the swap (e.g., create token accounts, add memos, close accounts).
Quote-only (no execution)GET /quoteDisplay pricing or route info without building a transaction.

Swap modes

ModeBehaviorUse case
ExactInYou specify the exact input amount. Output is estimated.”I want to sell exactly 1 SOL”
ExactOutYou specify the exact output amount. Input is estimated.”I want to buy exactly 100 USDC”
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

FeatureValue
Max hops5
Compute costStandard
Supported DEXsVortex, Fluxbeam, Fogo.fun, Moonit
Solana support coming soon with P-Token optimization enabling up to 7 hops, lower compute costs, and access to Raydium, Orca, and Meteora pools. See Supported Chains.

Supported tokens

Any SPL token with liquidity on a supported DEX can be swapped. The routing engine currently supports:
  • Vortex (concentrated liquidity)
  • Fluxbeam (AMM)
  • Fogo.fun (bonding curves)
  • 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.