Skip to main content
The Titan instructions module enables vault managers and allocators to swap tokens through Titan, a Solana DEX aggregator. The integration works in two steps: fetch a swap quote from Titan’s gateway, then wrap the resulting instruction in a Squads sync transaction.
Titan swap quotes are fetched from Titan’s REST gateway, which requires a base URL (baseUrl) and an auth token (authToken) issued by Titan.

Transaction Structure

Every Titan interaction goes through createVaultSyncTransaction, which returns three parts:

Fetching a Quote

TitanGatewayClient.quoteVaultSwapInstruction requests a swap route from Titan’s gateway and returns a TransactionInstruction along with any Address Lookup Table addresses needed for transaction compilation.

Parameters

Return Value

Titan swap quotes have a short expiry. Fetch the quote and submit the transaction promptly to avoid stale routes.

Executing a Swap

titanAction.swap wraps the instruction from quoteVaultSwapInstruction into a vault instruction descriptor for createVaultSyncTransaction.

Parameters

Passing addressLookupTableAddresses from the quote is strongly recommended — the sync transaction builder uses them to compress the final V0 message.
A matching policy must exist before executing. See Policy Builders.

Full Flow Example

This example demonstrates fetching a Titan swap quote and executing it through the vault.

Step 1: Fetch Swap Quote

Step 2: Execute Swap Through Vault