> For the complete documentation index, see [llms.txt](https://titan-exchange.gitbook.io/titan/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://titan-exchange.gitbook.io/titan/developer-doc/swap-api/reference/direct-vs-gateway.md).

# Titan Direct vs Titan Gateway

Two interfaces to the same execution infrastructure. Both route through Titan's advanced algorithms, return the same quote types, and produce identical quote quality and transaction output. **The difference is interface and workflow, not routing quality.**

## Titan Direct — WebSocket API

Titan Direct is a WebSocket API built for users where latency and execution are critical to their operations. Market makers, prop trading desks, and quant/algo traders operate in an environment where quote freshness and fill latency are existential.

A persistent WebSocket connection eliminates the overhead of repeated HTTP handshakes and allows Titan to push live quote updates without polling. Routes are served by Argos, Titan's proprietary routing engine — giving users the best available price across the full liquidity landscape.

**Titan Direct is the only WebSocket-native trading API on Solana. Built for traders who can't afford stale quotes.**

**Use Direct when you need:**

* Real-time streaming quotes that refresh automatically as on-chain state changes
* Persistent connections for trading bots, market making, or algorithmic strategies
* The lowest possible latency between quote and execution

## Titan Gateway — REST API

Titan Gateway is a REST API built for developers and projects integrating swap functionality into products — wallets, aggregators, DeFi protocols, and consumer apps. These teams work in REST environments and do not need to redesign their architecture for a WebSocket connection.

**Titan Gateway is the fastest path from zero to production-grade swap execution on Solana.**

**Gateway is not a simplified version of Direct.** It is purpose-built for integration workflows, backed by the same Argos routing engine that powers Direct — **the routing quality is identical.** The differentiation is purely about interface and integration workflow.

**Use Gateway when you need:**

* Standard REST endpoints that fit into existing backend infrastructure
* A single quote per user action — one-click swap buttons, price displays, or backend services
* Drop-in integration without WebSocket infrastructure

## Comparison

|                | Titan Direct                   | Titan Gateway                       |
| -------------- | ------------------------------ | ----------------------------------- |
| Interface      | WebSocket                      | REST                                |
| Quote delivery | Streaming — continuous updates | Per-request — one response per call |
| Connection     | Persistent                     | Stateless                           |

## API endpoint mapping

Every Titan Direct RPC method has a corresponding Gateway REST endpoint. The request parameters and response types are the same.

| Titan Gateway            | Titan Direct         |
| ------------------------ | -------------------- |
| `GET /api/v1/info`       | `GetInfo`            |
| `GET /api/v1/providers`  | `ListProviders`      |
| `GET /api/v1/venues`     | `GetVenues`          |
| `GET /api/v1/quote/swap` | `NewSwapQuoteStream` |

## Which should I use?

If you're not sure, start with Titan Direct. The [`@titanexchange/sdk-ts`](/titan/developer-doc/resources/sdk.md) SDK handles the WebSocket connection, MessagePack encoding, and compression negotiation for you. If your architecture requires REST or a persistent connection isn't practical, use Titan Gateway — you get the same routing quality through a familiar request/response pattern.

## Related pages

* [Quickstart](/titan/developer-doc/swap-api/quickstart.md) — first quote with both Direct and Gateway
* [Stream & Execute a Swap](/titan/developer-doc/swap-api/guides/stream-and-execute.md) — full Titan Direct guide
* [Connection & Negotiation](/titan/developer-doc/swap-api/reference/direct/connection.md) — WebSocket protocol details
* [Wire Protocol](/titan/developer-doc/swap-api/reference/wire-protocol.md) — MessagePack encoding and compression
