Skip to main content
This guide walks you through making your first trade on Bebop using the RFQ API. You’ll learn how to discover supported assets, request quotes, sign orders, and submit them for settlement.
What you’ll build: A complete trade flow from quote request to settlement.Time required: 10-15 minutesPrerequisites: Basic understanding of EVM wallets and token approvals.

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:
GET /pmm/chains
curl --get https://api.bebop.xyz/pmm/chains
Response (abridged):
{
  "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:
GET /pmm/{network}/v3/tokenlist
curl --get https://api.bebop.xyz/pmm/ethereum/v3/tokenlist
Response (abridged):
{
  "tokens": [
    {
      "chainId": 1,
      "address": "0xec53bF...1F83",
      "decimals": 18,
      "name": "Eigenlayer",
      "symbol": "EIGEN",
      "logoURI": "https://bebop-public-images.s3.eu-west-2...",
      "tags": [],
      "extensions": {
        "color": "#FFFFFF",
        "displayDecimals": 1,
        "availability": {
          "isAvailable": true,
          "canBuy": true,
          "canSell": true
        }
      }
    }
    ...
  ],
  "total": 398
}
Key fields:
FieldDescription
symbolHuman-readable token symbol
addressToken contract address - use this in all subsequent requests
decimalsFor converting human amounts to base units (e.g., 1 WETH = 1 × 10¹⁸ base units)
availability.canBuy/canSellWhether trading is enabled in either direction
Caching recommendation: Refresh token lists at least once daily. Token availability can change due to liquidity conditions or new listings.

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

Unauthenticated requests receive significantly worse prices and are heavily rate limited.
You can try the API in demo mode, however, we encourage you to request an API key to get production-grade pricing and higher limits.

Basic Quote Request

GET /pmm/{chain}/v3/quote
Required parameters:
ParameterDescriptionExample
sell_tokensToken(s) you’re selling (contract address)0xC02a... (WETH)
buy_tokensToken(s) you’re buying0xA0b8... (USDC)
sell_amounts OR buy_amountsAmount in base units. Use one, not both.1000000000000000000 (1 WETH)
taker_addressWallet executing the trade0xYourWalletAddress
gaslessSet to false for self-execution (default is true)false
  • 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”)
base_units = human_amount × 10^decimals
For example: 1.5 WETH (18 decimals) = 1.5 × 10¹⁸ = 1500000000000000000
Example - selling 1 WETH for USDC on Ethereum:
curl https://api.bebop.xyz/pmm/ethereum/v3/quote \
  --get \
  --data-urlencode "sell_tokens=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" \
  --data-urlencode "buy_tokens=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" \
  --data-urlencode "sell_amounts=1000000000000000000" \
  --data-urlencode "taker_address=0x2e7E7cc62919eAf4c502dAC34753cFc5A29e9693" \
  --data-urlencode "gasless=false"
Building a wallet or super-app? Bebop also supports gasless execution where Bebop submits on-chain on behalf of your users. See the Gasless guide for details.

Understanding the Response

{
  "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,
  "gasFee": {
    "native": "0",
    "usd": 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",
  "requiredSignatures": [],
  "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": [
    "🦙"
  ],
  "toSign": {
    "partner_id": 0,
    "expiry": 1773827371,
    "taker_address": "0x5Bad99...BcB6",
    "maker_address": "0xBEE321...a000",
    "maker_nonce": "3272802511230603750",
    "taker_token": "0xC02aaA...6Cc2",
    "maker_token": "0xA0b869...eB48",
    "taker_amount": "10000000000000000",
    "maker_amount": "23197992",
    "receiver": "0x5Bad99...BcB6",
    "packed_commands": "0"
  },
  "onchainOrderType": "SingleOrder",
  "partialFillOffset": 12
}
Key items to note:
FieldDescription
quoteIdUnique quote identifier for monitoring settlement
expiryUnix timestamp - order is invalid after this time
buyTokensTokens you’ll receive, keyed by contract address. amount is the guaranteed fill amount (no slippage).
approvalTargetContract that needs token approval (if not already approved). See the Token Approvals guide.
toSignEIP-712 message fields you must sign
txReady-to-broadcast transaction - sign the EIP-712 typed data and submit on-chain

3. Sign & Submit

With self-execution, the /v3/quote response includes a tx object ready to submit. You add your nonce and chainId, sign the transaction, and broadcast on-chain. There’s no separate order submission step.
Partial fills are also supported. See the Partial Fills guide for details.
The tx object from the quote response contains the complete settlement calldata. You just need to add your nonce and chainId, then sign and submit.
For gasless execution, you sign EIP-712 typed data and POST to /v3/order instead. See the EIP-712 order type schemas for the full type definitions (SingleOrder, MultiOrder, AggregateOrder).
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"

# --- 1. Request a quote ---
taker_address = "0x2e7E7cc62919eAf4c502dAC34753cFc5A29e9693"

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

# --- 2. Sign and submit the transaction ---

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

tx = quote["tx"]
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)
print(f'Settled in block {receipt["blockNumber"]}')
Key points:
StepWhat happens
SignSign the transaction using your private key
BroadcastSubmit the transaction on-chain via your RPC provider
SettlementTokens arrive at your receiver address in the same transaction

Next Steps

Ready to explore more? Dive into the guides:

Token Approvals

Manage token approvals for trading.

Gasless Execution

Let Bebop submit on-chain for your users - ideal for wallets and super-apps.

Partial Fills

Combine market maker and AMM liquidity.

Multi-Token Trades

Swap multiple tokens in a single transaction.