> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bebop.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Route trades through competing solvers for comprehensive token coverage.

The Aggregation API connects you to Bebop's network of solvers who compete to find the best execution path across all available decentralized liquidity sources.

## When to Use

* You need **broad token coverage** including long-tail assets that private market makers may not quote
* You prefer **solver competition** across all available on-chain liquidity rather than a single market maker's inventory
* You are willing to configure **slippage tolerance** in exchange for access to deeper, more diverse liquidity pools

## At a Glance

|                    |                                                           |
| ------------------ | --------------------------------------------------------- |
| **Transport**      | REST                                                      |
| **Authentication** | API key                                                   |
| **Signing**        | EIP-712 (gasless) / none (self-execution)                 |
| **On-chain tx**    | Bebop submits (gasless) or you broadcast (self-execution) |
| **Gasless**        | Yes (default)                                             |
| **Complexity**     | Medium - similar to RFQ, plus slippage configuration      |

## How It Works

The Aggregation API supports two execution modes. Gasless is the default and recommended for most integrations.

<Tabs>
  <Tab title="Gasless (default)">
    Bebop handles on-chain submission. Your users sign a message but never pay gas.

    | Step | Action              | You send                                        | You get back                                       |
    | ---- | ------------------- | ----------------------------------------------- | -------------------------------------------------- |
    | 1    | Request a quote     | Token pair, amount                              | Best solver price, EIP-712 typed data (`JamOrder`) |
    | 2    | Sign the order      | EIP-712 typed data → taker wallet               | Signature                                          |
    | 3    | Submit to Bebop     | Signature → `POST /jam/{network}/v2/order`      | Quote ID                                           |
    | 4    | Poll for settlement | Quote ID → `GET /jam/{network}/v2/order-status` | Status: `Settled`                                  |
  </Tab>

  <Tab title="Self-execution">
    You broadcast the transaction yourself for direct on-chain settlement.

    | Step | Action             | You send                            | You get back                   |
    | ---- | ------------------ | ----------------------------------- | ------------------------------ |
    | 1    | Request a quote    | Token pair, amount, `gasless=false` | Best solver price, `tx` object |
    | 2    | Broadcast on-chain | `tx` object → broadcast             | On-chain settlement            |
  </Tab>
</Tabs>

See [Execution Modes](/core-concepts/execution-modes) for a detailed comparison.

## Slippage Protection

The Aggregation API applies slippage protection to account for price movement between the quote and settlement. This is a key difference from the RFQ API, where quotes are firm with guaranteed execution and guaranteed fill.

The `slippage` parameter on the quote request sets the maximum acceptable price deviation (0-50%, up to 2 decimal places). When omitted, the solver determines an appropriate slippage based on the pair and current market conditions.

In the quote response:

| Field                            | Description                                                                       |
| -------------------------------- | --------------------------------------------------------------------------------- |
| `buyTokens.{addr}.amount`        | Expected fill amount (best case)                                                  |
| `buyTokens.{addr}.minimumAmount` | Guaranteed minimum after slippage                                                 |
| `toSign.buyAmounts`              | The `minimumAmount` values - this is what you sign and what the contract enforces |

The on-chain settlement reverts if the solver cannot deliver at least `buyAmounts`. Any amount above that minimum is surplus that benefits the taker.

## Key Endpoints

| Endpoint                             | Purpose                                      |
| ------------------------------------ | -------------------------------------------- |
| `GET /jam/{network}/v2/quote`        | Request a quote through solver competition   |
| `POST /jam/{network}/v2/order`       | Submit a signed order for gasless settlement |
| `GET /jam/{network}/v2/order-status` | Poll settlement status                       |

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="/aggregation-api/quickstart">
    Make your first trade in 10-15 minutes.
  </Card>

  <Card title="Token Approvals" icon="key" href="/core-concepts/token-approvals">
    Set up ERC-20 approvals before trading.
  </Card>
</CardGroup>
