Skip to main content

Environment Variables

Complete reference guide for configuring CoW Protocol BFF services. Copy .env.example to .env for local development or .env.docker for containerized deployments.

Application Settings

Blockchain RPC Endpoints

Configure RPC endpoints for each supported network:
WebSocket URLs (wss://) are recommended for real-time event monitoring.

Database Configuration

Primary Database (PostgreSQL)

Orderbook Database (Read-only)

Analytics Database

Redis Cache

Optional but highly recommended for production to reduce RPC calls.

RabbitMQ

Required for notification services.

External Services

CoW Protocol API

CoinGecko

Tenderly (Transaction Simulation)

Moralis

Ethplorer

Dune Analytics

Socket.tech

CMS Integration

Notification Producer

Telegram Bot

TWAP Service

JWT Authentication

CORS Configuration

Security Considerations

  • Never commit sensitive environment files to version control
  • Use secrets management systems for production:
    • AWS Secrets Manager
    • HashiCorp Vault
    • Kubernetes Secrets
  • Use strong, unique values for all passwords and API keys
  • Rotate credentials regularly

Example Configurations

Docker Compose

Local Development

Service-Specific Requirements

API Service

  • Requires: COW_API_BASE_URL, database configuration
  • Optional: Redis, Tenderly, CoinGecko, Moralis, Ethplorer, Socket

TWAP Service

  • Requires: Database configuration, Orderbook database
  • Optional: Redis

Notification Producer

  • Requires: RPC endpoints, database, RabbitMQ
  • Optional: Redis, CMS

Telegram Bot

  • Requires: TELEGRAM_SECRET, RabbitMQ, database
  • Optional: Redis
Last modified on March 4, 2026