WDK logoWDK documentation

Swap tokens with Velora

Quote and execute EVM token swaps through Velora for standard and smart-account wallet flows.

Use the Velora swap module to quote and execute token swaps on EVM chains. It works with standard EVM accounts and ERC-4337 smart accounts.

Version 1.0.0-beta.9 validates the quoted token pair and exact amount, and accepts minAmountOut to bound the output requested from the transaction builder. Review the quote and execution limits and wallet provider compatibility before upgrading.

Features

  • Token Swapping: Execute token swaps through velora on supported EVM networks
  • Account Abstraction: Compatible with standard EVM accounts and ERC‑4337 smart accounts
  • Fee Controls: Constructor and per-call swapMaxFee for standard and smart accounts, in the account quote's fee units
  • Approval-aware swaps: Approve input tokens with the wallet account before swapping when allowance is required
  • Provider Flexibility: Works with JSON‑RPC URLs and EIP‑1193 providers
  • TypeScript Support: Full TypeScript definitions included

Supported Networks

Works with EVM networks supported by velora (e.g., Ethereum, Polygon, Arbitrum, etc.). A working RPC provider is required.

Wallet Compatibility

The swap service supports multiple EVM wallet types:

  • Standard EVM Wallets: @tetherto/wdk-wallet-evm accounts
  • ERC‑4337 Smart Accounts: @tetherto/wdk-wallet-evm-erc-4337 accounts with bundler/paymaster
  • Read‑Only Accounts: For quoting swaps without sending transactions

The constructor accepts shared wallet interfaces, while the implementation requires an EVM provider in account._config.provider. Compatible wrappers must also expose the account methods used for quotes and execution. A callable sendTransaction() establishes writability; it does not establish chain or provider compatibility.

Key Components

  • velora Integration: Uses velora aggregator for routing and quotes
  • Quote System: Pre‑transaction fee and amount estimation via quoteSwap
  • AA Integration: Forward paymaster, sponsorship, and native-fee overrides to compatible ERC‑4337 accounts
  • Read-only quoting: Quote swaps from read-only EVM and ERC‑4337 accounts

Next Steps


Need Help?

On this page