Swap RPC
Introduction to Swap API
Explore how you can execute swap transactions with the Swap API.
The Swap API allows you to perform token swaps using decentralized exchanges with minimal hassle. Whether you’re building a wallet, a DeFi platform, or any application that benefits from transparent token swaps, the Swap API provides a robust mechanism to handle these transactions.
- If you’re swapping
from
an ERC-20 token, you’ll need to check token approval withcheckApprove
. If approval doesn’t meet your requirements for the swap, you’ll need to request approval. - Get a quote for the swap with
getQuote
. - Retrieve the swap transaction object with
getSwap
. - Execute the swap transaction.
Native tokens, such as ETH, are represented as
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Was this page helpful?