unchained icon indicating copy to clipboard operation
unchained copied to clipboard

Add CowSwap Tracker

Open premiumjibles opened this issue 1 month ago โ€ข 2 comments

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.ts tracker 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

  1. CowSwap order history API: https://api.cow.fi/docs
  2. How appData works for affiliate tracking
  3. 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)

premiumjibles avatar Dec 16 '25 23:12 premiumjibles

๐Ÿ“ CodeRabbit Plan Mode

Generate an implementation plan and prompts that you can use with your favorite coding agent.

  • [ ] Create Plan
Examples
You can configure auto-planning by selecting labels in the issue_enrichment configuration.

๐Ÿ”— 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!

coderabbitai[bot] avatar Dec 16 '25 23:12 coderabbitai[bot]

๐Ÿ“ CodeRabbit Plan Mode

Generate an implementation plan and prompts that you can use with your favorite coding agent.

  • [ ] Create Plan
Examples

๐Ÿ”— 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!

coderabbitai[bot] avatar Dec 18 '25 23:12 coderabbitai[bot]