Skip to main content

Account Endpoints

Account endpoints deliver current information about user token holdings and approvals for the CoW Protocol.

Get Account Balances

Endpoint: GET /{chainId}/accounts/{userAddress}/balances Retrieves token balances and approvals for a specified user address.

Parameters

Response Fields

  • balance: Token quantity in base units (wei-like format)
  • allowance: CoW Protocol vault relayer approval amount
  • token: Object containing token metadata
    • address: Contract address
    • decimals: Decimal places (typically 18)
    • symbol: Short identifier (e.g., “WETH”)
    • name: Full token name

Example Success Response

Code Examples

cURL:
JavaScript:
Python:

Error Responses


Stream Account Balances (SSE)

Endpoint: GET /{chainId}/accounts/{userAddress}/balances/sse Provides real-time streaming updates via Server-Sent Events for balance and allowance changes.

Parameters

Response Behavior

  • Initial Event: Current balances sent immediately upon connection
  • Update Events: Transmitted when balance or allowance changes
  • Ping Events: Keep-alive messages every 20 seconds

Event Examples

Balance Update:
Keep-Alive Ping:

Response Headers

Code Examples

cURL:
JavaScript:
Python:

Important Notes

Allowance Context

The allowance returned is specifically for the CoW Protocol vault relayer contract. This represents the approval amount verified during order placement. A typical maximum approval value is 115792089237316195423570985008687907853269984665640564039457584007913129639935.

Balance Format Details

Balances use token base units:
  • 18-decimal tokens: 1000000000000000000 equals 1 token
  • 6-decimal tokens (USDC): 1000000 equals 1 token
Convert to human-readable format:

SSE Connection Guidelines

  1. Keep-alive pings maintain connection every 20 seconds
  2. Server automatically stops tracking when all clients disconnect
  3. Multiple clients can monitor the same user; the server combines tracked tokens
  4. Be aware of concurrent connection limits

Local Testing

Test the SSE endpoint locally:

Performance Tips

  • Query multiple tokens in single requests for efficiency
  • SSE connections only transmit when changes occur
  • REST responses may cache for several seconds
  • Batch requests where possible
Last modified on March 4, 2026