Skip to main content

Affiliate Program Endpoints

Affiliate endpoints enable partners to register affiliate codes, retrieve program details, and access performance statistics.

Get Affiliate Information

Retrieves the affiliate code and program parameters for a wallet address. Endpoint: GET /affiliate/{address}

Path Parameters

  • address (string, required): Ethereum wallet address (checksummed or lowercase)

Response

Code Examples

Response Example


Register Affiliate Code

Registers a new affiliate code for a wallet address using EIP-712 signature verification. Endpoint: POST /affiliate/{address}

Path Parameters

  • address (string, required): Ethereum wallet address (must match walletAddress in body)

Request Body

  • walletAddress (string, required): Ethereum wallet address (must match path parameter)
  • code (string, required): Affiliate code to register. Format: 5-20 uppercase characters. Allowed: A-Z, 0-9, hyphens (-), underscores (_)
  • signedMessage (string, required): EIP-712 signature of the affiliate code registration message

Code Examples

Response Example

Error Responses


Get Affiliate Statistics

Retrieves performance statistics for an affiliate from Dune Analytics. Endpoint: GET /affiliate/affiliate-stats/{address}

Path Parameters

  • address (string, required): Affiliate’s Ethereum wallet address

Response

Code Examples


Get Trader Statistics

Retrieves statistics for a trader participating in the affiliate program. Endpoint: GET /affiliate/trader-stats/{address}

Path Parameters

  • address (string, required): Trader’s Ethereum wallet address

Response

Code Examples


Notes

Affiliate Code Requirements

  • Length: 5-20 characters
  • Characters: Uppercase A-Z, digits 0-9, hyphens (-), underscores (_)
  • Format: Automatically normalized to uppercase
  • Uniqueness: Each code can only be registered once

Signature Verification

The API uses EIP-712 signatures to verify wallet ownership:
  1. Domain: CoW Swap Affiliate version 1
  2. Chain ID: Always 1 (Ethereum Mainnet) for verification
  3. Message: Contains walletAddress, code, and chainId
Supports both EOA wallets (standard ECDSA) and smart contract wallets (ERC-1271). See Authentication for detailed signing examples.

Reward Structure

For Affiliates:
  • Earn fixed rewards when referred traders hit volume milestones
  • Receive percentage of trading fees based on revenueSplitAffiliatePct
For Traders:
  • Receive fee discounts based on revenueSplitTraderPct
  • Benefits active for timeCapDays after first trade
  • Volume capped at volumeCap per trader

CMS Requirement

Affiliate registration and retrieval require CMS integration:
  • Environment variable CMS_ENABLED must be set
  • CMS_API_KEY must be configured
Last modified on March 11, 2026