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:/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:| Field | Description |
|---|---|
symbol | Human-readable token symbol |
address | Token contract address - use this in all subsequent requests |
decimals | For converting human amounts to base units (e.g., 1 WETH = 1 × 10¹⁸ base units) |
availability.canBuy/canSell | Whether trading is enabled in either direction |
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
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
| 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 | Wallet executing the trade | 0xYourWalletAddress |
gasless | Set to false for self-execution (default is true) | false |
Choosing sell_amounts vs buy_amounts
Choosing sell_amounts vs buy_amounts
- Use
sell_amountswhen you know exactly how much you want to sell (e.g., “Sell 1 WETH”) - Use
buy_amountswhen you know exactly how much you want to receive (e.g., “Buy 5000 USDC”)
Converting human amounts to base units
Converting human amounts to base units
1500000000000000000Understanding the Response
| Field | Description |
|---|---|
quoteId | Unique quote identifier for monitoring settlement |
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). See the Token Approvals guide. |
toSign | EIP-712 message fields you must sign |
tx | Ready-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.
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).| 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: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.