Actions61
- End User Accounts Actions
- EVM Accounts Actions
- EVM Smart Accounts Actions
- EVM Swaps Actions
- EVM Token Balances Actions
- Faucets Actions
- Onchain Data Actions
- Onramp Actions
- Payments Alpha Actions
- Policy Engine Actions
- Solana Accounts Actions
- Solana Token Balances Actions
- SQL API Alpha Actions
- X 402 Facilitator Actions
EVM Swaps → Get Evm Swap Price
AI-generatedSummary
Retrieve the price for executing an EVM token swap.
Inputs
- network (required) — The network on which to perform the swap (e.g., Base, Ethereum, Arbitrum, Optimism).
- toToken (required) — The 0x-prefixed contract address of the token to receive.
- fromToken (required) — The 0x-prefixed contract address of the token to send.
- fromAmount (required) — The amount of the
fromTokento send, specified in atomic units. - taker (required) — The 0x-prefixed address holding the
fromTokenbalance, with thePermit2allowance set. - signerAddress — The 0x-prefixed EOA address for signing the
Permit2message, needed iftakeris a contract. - gasPrice — The target gas price for the swap in Wei; an estimate will be used if not provided.
- slippageBps — Maximum acceptable slippage of the
toTokenin basis points (0 for no slippage; defaults to 100 bps if not set). - requestOptions — Additional options for the request such as batching settings and timeout.
Output shape
a single record containing the swap price details
Response includes the estimated price for the swap based on the provided parameters.
Examples
Example 1: Get the swap price for exchanging ETH to USDC on the Ethereum network with a specified amount.
Network: Ethereum, From Token: 0x6B175474E89094C44Da98b954EedeAC495271d0F (ETH), To Token: 0x7F5c764cBc14f9669B88837ca1490cCa17c31607 (USDC), From Amount: 1000000000000000000 (1 ETH), Taker: 0xAc0974bec39a17e36ba4a6b4d238ff944bacb478, Slippage Bps: 100.
Example 2: Fetch swap price for a swap from DAI to USDT with tolerance for slippage on Optimism.
Network: Optimism, From Token: 0x6B175474E89094C44Da98b954EedeAC495271d0F (DAI), To Token: 0xdac17f958d2ee523a2206206994597c13d831ec7 (USDT), From Amount: 2000000000000000000 (2 DAI), Taker: 0xAc0974bec39a17e36ba4a6b4d238ff944bacb478, Slippage Bps: 200.