unchained icon indicating copy to clipboard operation
unchained copied to clipboard

feat: add cowswap affiliate tracking

Open premiumjibles opened this issue 1 month ago • 1 comments

Summary

This adds butterswap to our affiliate revenue tracker. The implementation is a bit of a best effort hack until we get a proper API from butter. It just queries the approximate block at the start and end of your time period, looks at total affiliate fees and takes the diff.

Testing

  • Make sure unchained ain't dead

If you want to properly test this locally:

  1. Install dependencies (from repo root) cd /home/sean/Repos/shapeshift-unchained yarn install

  2. Copy and configure env cp node/proxy/sample.env node/proxy/.env // Edit node/proxy/.env with real API keys (BEBOP_API_KEY, ZRX_API_KEY, etc.)

  3. Start reverse proxy (from repo root) docker-compose up -d reverse-proxy

  4. Start proxy API cd node/proxy docker-compose up

  5. Test endpoint (in another terminal)

curl "http://api.proxy.localhost/api/v1/affiliate/revenue?startTimestamp=1764547200&endTimestamp=1767225600"

Screenshots

image

premiumjibles avatar Dec 19 '25 09:12 premiumjibles

[!IMPORTANT]

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch 11439_cowswap_tracker

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Dec 19 '25 09:12 coderabbitai[bot]