Context
The ShapeShift affiliate revenue API aggregates fee data from multiple swap providers. CowSwap (CoW Protocol) is a DEX aggregator that ShapeShift integrates with. Adding CowSwap tracking increases revenue visibility.
Repository: shapeshift/unchained
Location: node/proxy/api/src/affiliateRevenue/
CowSwap Integration Details
API Base URL: https://api.cow.fi
How ShapeShift tracks affiliate: CowSwap uses appData - a hash that encodes metadata including the referrer/affiliate. Need to research how ShapeShift's appData is generated and how to query orders by appData.
Acceptance Criteria
Files to Create/Modify
node/proxy/api/src/affiliateRevenue/cowswap.ts (new file)
node/proxy/api/src/affiliateRevenue/index.ts (add import and integrate)
node/proxy/api/src/models.ts (add 'cowswap' to services array)
Research Required
- CowSwap order history API: https://api.cow.fi/docs
- How appData works for affiliate tracking
- Whether there's a direct way to query by affiliate/partner
Reference
- CowSwap API docs: https://api.cow.fi/docs
- Main app CowSwap integration:
packages/swapper/src/swappers/CowSwapper/ (in shapeshift/web repo)
Context
The ShapeShift affiliate revenue API aggregates fee data from multiple swap providers. CowSwap (CoW Protocol) is a DEX aggregator that ShapeShift integrates with. Adding CowSwap tracking increases revenue visibility.
Repository:
shapeshift/unchainedLocation:
node/proxy/api/src/affiliateRevenue/CowSwap Integration Details
API Base URL:
https://api.cow.fiHow ShapeShift tracks affiliate: CowSwap uses
appData- a hash that encodes metadata including the referrer/affiliate. Need to research how ShapeShift's appData is generated and how to query orders by appData.Acceptance Criteria
cowswap.tstracker following existing patternsmodels.tsindex.tsFiles to Create/Modify
node/proxy/api/src/affiliateRevenue/cowswap.ts(new file)node/proxy/api/src/affiliateRevenue/index.ts(add import and integrate)node/proxy/api/src/models.ts(add 'cowswap' to services array)Research Required
Reference
packages/swapper/src/swappers/CowSwapper/(in shapeshift/web repo)