> ## 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.

# Quickstart

> Make your first trade on Bebop using the RFQ API - from quote request to settlement.

This guide shows how to discover supported assets, request a quote, approve tokens, and broadcast the settlement transaction.

<Info>
  **What you'll build:** A complete trade flow from quote request to settlement.

  **Time required:** 10-15 minutes

  **Prerequisites:** Basic understanding of EVM wallets and token approvals.
</Info>

<Note>
  The trading example below uses EVM. Solana RFQ quotes return `solana_tx` and `blockhash` instead of `tx`.
</Note>

## 1. Discover Supported Chains and Tokens

Before requesting quotes, identify which chains and tokens Bebop supports. This information changes as new assets are added, so your integration should refresh it regularly.

### Get Supported Chains

Retrieve the supported blockchains:

```text theme={null}
GET /pmm/chains
```

<CodeGroup>
  ```bash bash theme={null}
  curl --get https://api.bebop.xyz/pmm/chains
  ```

  ```python python theme={null}
  import httpx

  resp = httpx.get("https://api.bebop.xyz/pmm/chains")
  data = resp.json()
  print(data)
  ```
</CodeGroup>

Response (abridged):

```json theme={null}
{
  "ethereum": 1,
  "polygon": 137,
  "arbitrum": 42161,
  "optimism": 10,
  "base": 8453,
  "bsc": 56,
  "hyperevm": 999,
  "avalanche": 43114,
  "solana": 2,
  ...
}
```

Use these network names in subsequent API calls (e.g., `/pmm/ethereum/v3/quote`).

### Get Tokens for a Chain

Once you know which chain you want to trade on, retrieve the list of supported tokens:

```text theme={null}
GET /pmm/{network}/v3/tokens
```

<CodeGroup>
  ```bash bash theme={null}
  curl --get https://api.bebop.xyz/pmm/ethereum/v3/tokens
  ```

  ```python python theme={null}
  import httpx

  resp = httpx.get("https://api.bebop.xyz/pmm/ethereum/v3/tokens")
  data = resp.json()

  tokens = data.get("tokens", {})  # dict: ticker -> token info

  for ticker, t in list(tokens.items())[:5]:
      info = t.get("chainInfo") or [{}]
      chain = info[0]
      addr = chain.get("contractAddress", "")
      print(f'{ticker} ({addr[:10]}...) decimals={chain.get("decimals")}')
  ```
</CodeGroup>

Response (abridged):

```json theme={null}
{
  "tokens": {
    "EIGEN": {
      "name": "Eigenlayer",
      "ticker": "EIGEN",
      "availability": {
        "isAvailable": true,
        "canBuy": true,
        "canSell": true
      },
      "priceUsd": 0.231681,
      "rfqaSupported": false,
      "cid": "eigenlayer",
      "displayDecimals": 1,
      "colour": "#FFFFFF",
      "tags": [],
      "iconUrl": "https://bebop-public-images.s3.eu-west-2.amazonaws.com/1-0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83.svg",
      "chainInfo": [
        {
          "chainId": 1,
          "contractAddress": "0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83",
          "decimals": 18
        }
      ]
    },
    ...
  },
  "metadata": {
    "lastUpdate": "1784791364.774951"
  }
}
```

Key fields:

| Field | Description |
| - | - |
| `ticker` | Human-readable token symbol |
| `chainInfo.contractAddress` | Token contract address - use this in all subsequent requests |
| `chainInfo.decimals` | For converting human amounts to base units (e.g., 1 WETH = 1 × 10¹⁸ base units) |
| `availability.canBuy/canSell` | Whether liquidity is available in either direction |

<Tip>
  **Caching recommendation:** Refresh tokens at least once daily. Token availability can change due to liquidity conditions or new listings.
</Tip>

## 2. Request a Quote

Quotes return the exact price and settlement parameters for your trade. Regular quotes expire typically within 60-75 seconds (depending on the blockchain), so request them when you're ready to execute.

### Authentication

<Warning>
  Unauthenticated requests receive significantly worse prices and are heavily rate limited.
</Warning>

You can try the API in demo mode, however, we encourage you to [request an API key](/core-concepts/authentication) to get production-grade pricing and higher limits.

### Basic Quote Request

```text theme={null}
GET /pmm/{chain}/v3/quote
```

Required parameters:

| Parameter | Description | Example |
| - | - | - |
| `sell_tokens` | Token(s) you're selling (contract address) | `0xC02a...` (WETH) |
| `buy_tokens` | Token(s) you're buying | `0xA0b8...` (USDC) |
| `sell_amounts` OR `buy_amounts` | Amount in base units. Use one, not both. | `1000000000000000000` (1 WETH) |
| `taker_address` | Address that supplies the sell tokens | `0xYourWalletAddress` |
| `receiver_address` | Address to receive bought tokens (if different from taker) | `taker_address` |

<Note>
  **Direct wallet flow:** Use the sending wallet as `taker_address`. `receiver_address` receives the bought tokens and defaults to `taker_address`.
</Note>

<Accordion title="Choosing sell_amounts vs buy_amounts">
  * 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")
</Accordion>

<Accordion title="Converting human amounts to base units">
  ```text theme={null}
  base_units = human_amount × 10^decimals
  ```

  For example: 1.5 WETH (18 decimals) = 1.5 × 10¹⁸ = `1500000000000000000`
</Accordion>

Example - selling 0.01 WETH for USDC on Ethereum:

<CodeGroup>
  ```bash bash theme={null}
  curl https://api.bebop.xyz/pmm/ethereum/v3/quote \
    --get \
    --data-urlencode "sell_tokens=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" \
    --data-urlencode "buy_tokens=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" \
    --data-urlencode "sell_amounts=10000000000000000" \
    --data-urlencode "taker_address=0x5Bad996643a924De21b6b2875c85C33F3c5bBcB6"
  ```

  ```python python theme={null}
  import httpx
  from web3 import Web3

  NETWORK = "ethereum"
  URL = f"https://api.bebop.xyz/pmm/{NETWORK}/v3/quote"

  buy_token = Web3.to_checksum_address(
      "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
  )  # USDC

  sell_token = Web3.to_checksum_address(
      "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
  )  # WETH

  sell_token_decimals = 18
  sell_amounts = 0.01

  params = {
      "buy_tokens": buy_token,
      "sell_tokens": sell_token,
      "sell_amounts": int(sell_amounts * 10**sell_token_decimals),
      "taker_address": "0x5Bad996643a924De21b6b2875c85C33F3c5bBcB6",
  }

  response = httpx.get(URL, params=params)
  data = response.json()
  print(data)
  ```
</CodeGroup>

### Understanding the Response

The response below shows the fields that you need for the direct transaction flow.

```json theme={null}
{
  "requestId": "dd78b459-2dcf-4478-9393-5e9d10e1d573",
  "type": "121",
  "status": "SIG_SUCCESS",
  "quoteId": "121-897150427680310661818327515657942468...",
  "chainId": 1,
  "approvalType": "Standard",
  "nativeToken": "ETH",
  "taker": "0x5Bad99...BcB6",
  "receiver": "0x5Bad99...BcB6",
  "expiry": 1773827371,
  "slippage": 0.0,
  "buyTokens": {
    "0xA0b869...eB48": {
      "amount": "23197992",
      "decimals": 6,
      "priceUsd": 0.999863,
      "symbol": "USDC",
      "minimumAmount": "23197992",
      "price": 0.0004310717927655118,
      "priceBeforeFee": 0.00042891596855834495,
      "amountBeforeFee": "23314591",
      "deltaFromExpected": -0.005043930479229898
    }
  },
  "sellTokens": {
    "0xC02aaA...6Cc2": {
      "amount": "10000000000000000",
      "decimals": 18,
      "priceUsd": 2331.24,
      "symbol": "WETH",
      "price": 2319.7992,
      "priceBeforeFee": 2331.4590113330582
    }
  },
  "settlementAddress": "0xbbbbbB...AD5F",
  "approvalTarget": "0xbbbbbB...AD5F",
  "priceImpact": -0.005043930479229898,
  "partnerFee": {
    "0xEeeeeE...EEeE": "50000000000000"
  },
  "warnings": [],
  "info": "You are using Bebop's public API. For hi...",
  "tx": {
    "to": "0xbbbbbB...AD5F",
    "value": "0x0",
    "data": "0x4dcebcba000000000000000000000000000000...",
    "from": "0x5Bad99...BcB6",
    "gas": 91793,
    "gasPrice": 154958393
  },
  "makers": [
    "🦙"
  ],
  "onchainOrderType": "SingleOrder",
  "partialFillOffset": 12
}
```

Key items to note:

| Field | Description |
| - | - |
| `quoteId` | Quote identifier for logs and support requests |
| `expiry` | Unix timestamp - order is invalid after this time |
| `buyTokens` | Tokens you'll receive, keyed by contract address. `amount` is the guaranteed fill amount (no slippage). |
| `approvalTarget` | Contract that needs token approval (if not already approved). |
| `tx` | Complete transaction that you sign and broadcast |

<Warning>
  **Important.** Make sure `approvalTarget` is always picked up from the quote response, not hardcoded. You may receive different targets for different quotes depending on how the trade is handled.

  As of June 2026, you may see either of the following two contracts in the quote response:

  * router contract: `0xBeb0009ACa35087ce7cCF11637E24dd1Aad3bf2A`
  * settlement contract: `0xbbbbbBB520d69a9775E85b458C58c648259FAD5F`

  See [Smart Contracts](/core-concepts/settlement-smart-contracts) and [Token Approvals guide](/core-concepts/token-approvals) for more information.
</Warning>

## 3. Approve the Sell Token

Approve the current quote's `approvalTarget` for the sell amount. Confirm the approval transaction before settlement.

See [Token Approvals](/core-concepts/token-approvals) for the allowance check and approval code.

## 4. Sign and Broadcast

The `/v3/quote` response includes a `tx` object that is ready to submit.

<Note>
  For Permit2 trades through BebopRouter, follow the [Permit2 self-execution guide](/rfq-api/guides/router-migration-guide#permit2-self-execution) before broadcasting.

  Partial fills are also supported. See the [Partial Fills guide](/rfq-api/guides/partial-fills) for details.
</Note>

Add your `nonce` and `chainId`. Then sign and broadcast the transaction before the quote expires.

```python theme={null}
import httpx
from eth_account import Account
from web3 import Web3

PRIVATE_KEY = "0x<your_private_key_hex>"
RPC_URL = "https://eth.llamarpc.com"
NETWORK = "ethereum"

w3 = Web3(Web3.HTTPProvider(RPC_URL))
account = Account.from_key(PRIVATE_KEY)

# --- 1. Request a quote for the signing account ---

response = httpx.get(
    f"https://api.bebop.xyz/pmm/{NETWORK}/v3/quote",
    params={
        "buy_tokens": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "sell_tokens": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "sell_amounts": 1000000000000000000,
        "taker_address": account.address,
    },
)
response.raise_for_status()
quote = response.json()

# --- 2. Approve quote["approvalTarget"] before settlement, if necessary ---
# See the Token Approvals guide for the complete allowance flow.

# --- 3. Sign and broadcast the settlement transaction ---

tx = quote["tx"]
if tx["from"].lower() != account.address.lower():
    raise ValueError("The quote taker does not match the signing account")
tx["nonce"] = w3.eth.get_transaction_count(account.address)
tx["chainId"] = quote["chainId"]

signed_tx = w3.eth.account.sign_transaction(tx, account.key)
tx_hash = w3.eth.send_raw_transaction(signed_tx.raw_transaction)

print(f"Transaction: {tx_hash.hex()}")
receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
if receipt["status"] != 1:
    raise RuntimeError("Settlement transaction reverted")
print(f'Settled in block {receipt["blockNumber"]}')
```

Key points:

| Step | What happens |
| - | - |
| Sign | Sign the transaction using your private key |
| Broadcast | Submit the transaction on-chain via your RPC provider |
| Settlement | Tokens arrive at your `receiver` address in the same transaction |

## Next Steps

Ready to explore more? Dive into the guides:

<CardGroup cols={2}>
  <Card title="Token Approvals" icon="key" href="/core-concepts/token-approvals">
    Manage token approvals for trading.
  </Card>

  <Card title="Partial Fills" icon="chart-pie" href="/rfq-api/guides/partial-fills">
    Combine market maker and AMM liquidity.
  </Card>

  <Card title="Multi-Token Trades" icon="arrows-rotate" href="/rfq-api/guides/multi-token-trades">
    Swap multiple tokens in a single transaction.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.