Skip to main content
type ExecuteSwapOptions = {
  network: EvmSwapsNetwork;
  fromToken: EvmAddress;
  toToken: EvmAddress;
  fromAmount: string;
  slippageBps?: number;
  account?: EvmAddress;
  useCdpPaymaster?: boolean;
  paymasterUrl?: string;
  idempotencyKey?: string;
};
Request parameters for executing a token swap.

Properties

PropertyTypeDescription
networkEvmSwapsNetworkThe network on which to perform the swap.
fromTokenEvmAddressThe 0x-prefixed contract address of the token to sell.
toTokenEvmAddressThe 0x-prefixed contract address of the token to buy.
fromAmountstringThe amount of fromToken to sell, in atomic units.
slippageBps?numberMaximum slippage in basis points (100 = 1%). Default is 100.
account?EvmAddressThe taker account address. If omitted, auto-selected from the signed-in user’s accounts.
useCdpPaymaster?booleanWhether to use the CDP Paymaster for gas sponsorship. Only applicable for smart accounts; ignored for EOA. Cannot be used together with paymasterUrl.
paymasterUrl?stringCustom paymaster URL for gas sponsorship. Only applicable for smart accounts; ignored for EOA. Cannot be used together with useCdpPaymaster.
idempotencyKey?stringOptional idempotency key for safe retries.