Skip to content

Add CowSwap Tracker #1238

@premiumjibles

Description

@premiumjibles

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

  • 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions