Wallet API: Submitting Swaps
Overview
The Wallet API provides a convenient way to execute swaps using CDP EVM accounts. This feature combines the core Swap APIs (which handle price discovery and quote creation) with the Wallet API’s ability to sign and broadcast transactions.
For detailed information about the core Swap APIs (price discovery and quote creation), see the Swap APIs documentation.
The Swap API currently supports Ethereum and Base mainnet networks only. Additional network support will be added in future updates.
Prerequisites
It is assumed you have already completed the Wallet API Quickstart guide and have a CDP account ready to use.
Using CDP Accounts
When using CDP EVM Accounts, we offer two options for submitting swaps:
- All-in-one swap (recommended): Submit a swap in one call
- Quote, then swap (advanced): Create a quote first, then execute the swap. This is useful for detailed swap inspection or custom logic.
These actions may reserve funds onchain, and are strictly rate-limited.
Code Examples
For complete code examples showing how to execute swaps with both regular accounts (EOAs) and Smart Accounts using CDP Wallets, see the Swap API Quickstart guide:
- Regular Accounts (EOAs) - Price estimation, creating quotes, and executing swaps with standard accounts
- Smart Accounts - Leveraging ERC-4337 features like gas sponsorship and batch operations
The quickstart guide includes examples in both TypeScript and Python, along with links to full implementations on GitHub.
What to read next
- Swap API Documentation: Learn more about the core Swap APIs for price discovery and quote creation
- Quickstart Guide: Step-by-step examples for implementing swaps
- Smart Accounts: Learn about using ERC-4337 Smart Accounts for advanced features