> For the complete documentation index, see [llms.txt](https://docs.bullpen.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bullpen.fi/execution/trade-routing.md).

# Trade Routing

Bullpen automatically routes your trades to the optimal execution venue based on the asset and market type.

## Routing Decision Tree

```
Is it a perpetual futures trade?
├── Yes → Hyperliquid
└── No (Spot trade)
    ├── Is the asset listed on Hyperliquid spot?
    │   ├── Yes → UNIT (Hyperliquid spot orderbook)
    │   └── No → Jupiter Ultra (Solana)
```

You don't need to choose venues manually. Bullpen handles routing behind the scenes.

## Why This Architecture?

Each venue is optimized for different use cases:

| Venue             | Best For          | Why                                         |
| ----------------- | ----------------- | ------------------------------------------- |
| **Hyperliquid**   | Perps, major spot | Onchain CLOB, deep liquidity, low latency   |
| **UNIT**          | HL-listed spot    | Direct access to Hyperliquid spot book      |
| **Jupiter Ultra** | Solana tokens     | Meta-aggregation, MEV protection, any token |

## Execution Quality

### Hyperliquid (Perps & Spot)

Hyperliquid operates a fully onchain central limit order book. Key properties:

* **Deterministic execution**: Every order, cancel, and trade recorded onchain
* **Price-time priority**: Best prices first, oldest orders first at same price
* **Block-level finality**: Trades settle in the same block
* **No front-running**: Matching happens in consensus layer

Latency is sub-second for order placement and matching.

### Jupiter Ultra (Solana Spot)

Ultra provides institutional-grade execution for Solana tokens:

* **Meta-aggregation**: Compares routes across Iris, JupiterZ, DFlow, Hashflow, OKX
* **Predictive execution**: Simulates actual execution quality, not just quoted prices
* **MEV protection**: ShadowLane keeps transactions private until landing
* **Sub-second landing**: 50-400ms typical

On average, Jupiter Ultra achieves **+0.63 bps positive slippage**, meaning you get slightly more than quoted.

## Slippage & Price Impact

### Perps

Slippage depends on:

* Order size relative to book depth
* Current spread
* Market volatility

Use limit orders to control execution price. TWAP for large orders.

### Spot (Hyperliquid)

Same mechanics as perps. Orderbook-based execution.

### Spot (Solana via Ultra)

Ultra's Real-Time Slippage Estimator (RTSE) dynamically sets appropriate slippage based on:

* Token volatility history
* Current liquidity depth
* Recent execution patterns

You can override with manual slippage in Settings.

## Fees

| Venue             | Maker  | Taker           |
| ----------------- | ------ | --------------- |
| Hyperliquid Perps | Rebate | 0.025%          |
| Hyperliquid Spot  | Varies | Varies          |
| Jupiter Ultra     | N/A    | Route-dependent |

*Fees subject to change. Check current rates in the app.*

Builder codes and referral discounts may apply. See Hyperliquid docs for current fee schedules.

## Failed Transactions

### Hyperliquid

Orders can fail if:

* Insufficient margin
* Price moved past limit
* Position would exceed max size

Failed orders return an error immediately. No funds are lost.

### Solana (Jupiter)

Transactions can fail due to:

* Slippage exceeded
* Insufficient SOL for gas (if gasless not available)
* Network congestion

Jupiter Ultra's high landing rate (sub-second) minimizes failures. If a swap fails, your tokens remain in your wallet.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bullpen.fi/execution/trade-routing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
