Skip to main content

Vault

The Vault module provides utilities for integrating CoW Protocol with Balancer Vault, enabling advanced trading features like internal balance usage and batch swaps.

Constants

VAULT_INTERFACE

A partial ABI interface for the Balancer Vault containing methods for manageUserBalance and batchSwap:

Key Addresses (Mainnet)

Functions

grantRequiredRoles

Grants necessary permissions to the CoW Protocol Vault Relayer.
This function is intended to be called by the Balancer Vault admin, not by traders.

Balance Types

Users can configure token handling through three balance types:

Example

On networks where the Balancer Vault contract has a known compromised admin key (notably Ethereum mainnet, Gnosis Chain, Arbitrum, and Base), using INTERNAL or EXTERNAL balance types may expose users to risk. The CoW Protocol API rejects orders using these balance types on affected networks. Always use ERC20 balance type unless you have verified that the Balancer Vault on your target network is safe (e.g., Plasma, which uses a non-compromised deployment).
Internal balance operations have different gas cost characteristics than standard ERC20 transfers. Test thoroughly on testnets before using Vault integration in production.
Last modified on March 12, 2026