Skip to main content
This guide walks you through making your first trade using the Aggregation API. You’ll request a quote, sign an EIP-712 message, submit the order, and poll for settlement.
What you’ll build: A complete trade flow using solver auction liquidity.Time required: 10-15 minutesPrerequisites: Basic understanding of EVM wallets and token approvals.

How It Differs from the RFQ API

The RFQ API provides firm market maker quotes with guaranteed execution and guaranteed fill. The Aggregation API runs a solver auction - multiple solvers compete to fill your order across all available on-chain liquidity. This gives you broader token coverage (including long-tail assets) at the cost of requiring a slippage tolerance.

1. Request a Quote

Required parameters: Optional parameters:
Permit2 approval type is only supported with gasless execution. Self-execution requires Standard approvals.
Swap and send: taker_address signs the order; the bought tokens go to receiver_address. receiver_address is optional and defaults to taker_address. Works in both gasless and self-execution modes.
  • Use sell_amounts when you know exactly how much you want to sell (e.g., “Sell 1 WETH”)
  • Use buy_amounts when you know exactly how much you want to receive (e.g., “Buy 5000 USDC”)
Example - selling 1 WETH for USDC on Ethereum:

Understanding the Response

The response structure depends on whether you requested gasless or self-execution mode. Gasless response - includes toSign (the EIP-712 message you must sign). No tx object since Bebop handles on-chain submission:
Self-execution response - includes both a tx object (settlement calldata ready to broadcast) and toSign:
Key fields:

2. Approve Tokens

Before the settlement contract can move your sell tokens, you need an ERC-20 approval on the approvalTarget address from the quote response. See the Token Approvals guide for the full check-and-approve flow.
With approval_type=Permit2 (gasless only), the approval goes to the Permit2 contract instead, and the taker signs a Permit2 message bundled with the order. This avoids needing a separate on-chain approval transaction for each new spender.

3. Sign & Submit

The Aggregation API supports two execution modes. Choose the one that fits your integration:
With self-execution (gasless=false), the quote response includes a tx object containing the complete settlement calldata. You broadcast the transaction yourself.
With self-execution, there’s no separate EIP-712 signing step and no /order POST. The tx object contains everything needed for settlement.

Permit2 Signing Variant

When using approval_type=Permit2 with gasless execution, the signing structure changes. Instead of signing JamOrder directly, you sign a PermitBatchWitnessTransferFrom that wraps the order:
The domain changes to the Permit2 contract:
The quote response toSign will contain permitted, spender, nonce, deadline, and witness (which is the JamOrder data) instead of the flat JamOrder fields.

4. Poll for Settlement

Both execution modes support status polling via /order-status.
Order statuses: The status response also includes:

Full Example

Next Steps

Token Approvals

Set up ERC-20 approvals before trading.

RFQ API Quickstart

Compare with the RFQ API for firm market maker pricing.