Add CowSwap Tracker
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.
Current Problem: CowSwap was listed as "low priority follow-up" in the original handoff but should be implemented for complete revenue tracking.
CowSwap Integration Details
API Base URL: https://api.cow.fi (from ShapeShift app config)
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
- [ ] Research CowSwap API for order history endpoints
- [ ] Identify how to filter orders by ShapeShift affiliate (appData or other mechanism)
- [ ] Create
cowswap.tstracker following existing patterns - [ ] Handle pagination if the API requires it
- [ ] Extract fee data from order responses
- [ ] Add 'cowswap' to services array in
models.ts - [ ] Import and call cowswap tracker in
index.ts
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)
๐ CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
- [ ] Create Plan
๐ Related PRs
shapeshift/unchained#1166 - feat: index affiliate revs by asset [merged] shapeshift/web#10911 - fix: butter cross-chain/swaps status introspection [merged] shapeshift/web#11164 - feat: near affiliate fees [merged] shapeshift/web#11360 - feat: add bsc support to CoW swapper [merged] shapeshift/unchained#1228 - feat: affiliate revenue tracker and endpoint [closed]
๐ค Suggested Assignees
๐งช Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
๐ฌ Have feedback or questions? Drop into our discord or schedule a call!
๐ CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
- [ ] Create Plan
๐ Similar Issues
Possible Duplicates
- https://github.com/shapeshift/web/issues/11439
Related Issues
- https://github.com/shapeshift/web/issues/11465
- https://github.com/shapeshift/unchained/issues/1238
๐ Related PRs
shapeshift/unchained#1166 - feat: index affiliate revs by asset [merged] shapeshift/web#10911 - fix: butter cross-chain/swaps status introspection [merged] shapeshift/web#11164 - feat: near affiliate fees [merged] shapeshift/web#11360 - feat: add bsc support to CoW swapper [merged] shapeshift/unchained#1228 - feat: affiliate revenue tracker and endpoint [merged]
๐ค Suggested Assignees
๐งช Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
๐ฌ Have feedback or questions? Drop into our discord or schedule a call!