Skip to main content

swap_tokens

Swap tokens using the CoW Protocol. This is the main high-level function for executing token swaps.
CowContractAddress.VAULT_RELAYER needs to be approved to spend the sell token before calling this function.

Parameters

Returns

Returns a CompletedOrder object.

Usage

With Safe Multi-Sig


CompletedOrder

A Pydantic model representing a successfully created order.

Fields

Explorer URLs

The URL points to CoW Explorer based on the chain:
  • Mainnet: https://explorer.cow.fi/ethereum/orders/{uid}
  • Gnosis Chain: https://explorer.cow.fi/gc/orders/{uid}
  • Arbitrum: https://explorer.cow.fi/arb1/orders/{uid}
Last modified on March 11, 2026