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
walletAddressin 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:- Domain:
CoW Swap Affiliateversion1 - Chain ID: Always
1(Ethereum Mainnet) for verification - Message: Contains
walletAddress,code, andchainId
Reward Structure
For Affiliates:- Earn fixed rewards when referred traders hit volume milestones
- Receive percentage of trading fees based on
revenueSplitAffiliatePct
- Receive fee discounts based on
revenueSplitTraderPct - Benefits active for
timeCapDaysafter first trade - Volume capped at
volumeCapper trader
CMS Requirement
Affiliate registration and retrieval require CMS integration:- Environment variable
CMS_ENABLEDmust be set CMS_API_KEYmust be configured