Titan Swap API

The Titan Swap API is available for all customers with an active Solana Subscription.

What is Titan?

The Titan Swap API allows you to stream price updates in real-time. The Argos routing engine serves as a meta-aggregator, sourcing data from multiple DEX aggregators and RFQ sources.

Titan Prime offers a unique websocket implementation that streams quote information. This significantly lowers latency and allows front-ends to update prices in real-time without overwhelming the server with HTTP requests.

Key Features

  • Real-time Streaming: WebSocket implementation for continuous live price updates

  • Meta-Aggregator: Sources from multiple DEX aggregators and RFQ sources to minimize slippage

  • Low Latency: Stream quotes faster than REST polling

Use Cases

Titan Swap API is ideal for:

  • Trading interfaces requiring real-time price updates

  • Price monitoring dashboards

  • Trading bots that need low-latency price feeds

  • Wallets with live swap pricing

Getting Started

To access the Titan Swap API through Triton One, use the following pathing:

Please make sure you use wss:// and not https:// as this is a websocket-based service.

Example Connection

Executing a Swap

When you receive quote updates via the WebSocket stream, each quote contains swap route information:

  1. Connect to WebSocket: Establish connection (as shown above)

  2. Request Swap Quotes: Send a NewSwapQuoteStream request with your swap parameters

  3. Receive Quote Stream: Get continuous updates with the best routes from multiple providers

  4. Select a Quote: Choose the best quote based on your criteria (price, provider, etc.)

  5. Execute: The quote contains either:

  • Instructions: Build and sign a transaction with the provided instructions

  • Transaction: A ready-to-sign transaction that you can directly sign and submit

Each SwapRoute in the stream includes all the data needed to execute the swap.

For complete details on the request/response format and executing swaps from streaming quotes, refer to the official documentation.

Pricing

The cost for using streaming services with Triton One is $0.05 per GB.

Availability

Titan Swap API is available for all customers with an active Solana Subscription, on both shared RPC pools and dedicated nodes.

API Documentation

To learn about how to use the Titan Swap API, please refer to the Titan Swap API docs here: https://titan-exchange.gitbook.io/titan/titan-developer-docs/apis/swap-api#websocket-connectionsarrow-up-right

A TypeScript SDK is also available: https://www.npmjs.com/package/@titanexchange/sdk-tsarrow-up-right

Read more: https://blog.triton.one/titan-prime-api-for-solana-swaps-is-live-on-triton/arrow-up-right

Last updated

Was this helpful?