GPv2VaultRelayer API
TheGPv2VaultRelayer contract serves as an intermediary between CoW Protocol’s settlement system and Balancer Vault, facilitating fund transfers and swap execution with protocol fees.
State Variables
Access Control
onlyCreator modifier.
Functions
transferFromAccounts
Moves sell token amounts from user accounts to the settlement contract.batchSwapWithFee
Executes multi-step swaps through Balancer pools and simultaneously collects protocol fees.
Returns:
int256[] - Token deltas indicating amounts sent and received.
The function handles both sell orders (GIVEN_IN) and buy orders (GIVEN_OUT) swap kinds.
Security
- Access restricted exclusively to the creator through
onlyCreator - Unauthorized calls revert with
"GPv2: not creator" - Immutable state prevents tampering
- Users never interact with this contract directly