
Data flow
Components
API Server. HTTP service that handles quote requests, builds swap transactions, and returns raw instructions. Stateless and horizontally scalable. Routing Engine. Off-chain route search that evaluates routes across all supported DEXs on Fogo. Finds direct swaps, multi-hop paths (e.g., Token A → FOGO → USDC → Token B), and split routes across multiple pools. Supported DEXs. Vortex (concentrated liquidity), Fluxbeam (AMM), Fogo.fun (bonding curves), and Moonit (bonding curves). On-chain Program. Verifies and executes the swap instructions atomically. If any hop fails or slippage is exceeded, the entire transaction reverts.Three integration paths
| Path | Endpoint | Use case |
|---|---|---|
| Transaction | POST /api/v1/swap | Get a ready-to-sign transaction. Sign it and submit. Simplest integration. |
| Instructions | POST /api/v1/instructions | Get raw instructions to compose with your own transaction logic (e.g., adding custom instructions before/after the swap). |
| CPI accounts | POST /api/v1/cpi/route-accounts | Call the route instruction on-chain from another program via CPI, signed by your program’s PDA. Makes a swap one atomic step inside your protocol. See Composing Swaps On-Chain. |
GET /api/v1/quote to find the best route. For prices that update in
real time, the API also exposes a WebSocket quote stream that pushes a new
quote whenever a pair’s price changes.