# Grant Application: Data pipeline for calculating trade envy of CoWAMM pools

**URL:** <https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836>\
**Category:** CoW Grants Program\
**Tags:** complete, grant-funded\
**Created:** [February 15, 2025, 3:04pm UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836 "2025-02-15T15:04:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommel](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tommel](https://forum.cow.fi/u/tommel)\
**Post date:** [February 15, 2025, 3:04pm UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/1 "2025-02-15T15:04:26Z")

</div>

Grant Title:

A data pipeline for calculating trade envy of CoWAMM pools

* * *

Author:

Name: Thomas Niedermayer

GitHub Username: Tommel71

Email: [thomas.n71@gmail.com](mailto:thomas.n71@gmail.com)

* * *

About You:

My name is Thomas Niedermayer, I am a data engineer at Iknaio where my main focus is on developing Graphsense, the leading open source crypto asset analytics software and on creating analyses for law enforcement to solve large scale crypto crime cases. This year, I published a paper on detecting bots on Ethereum ([https://dl.acm.org/doi/10.1145/3589335.3651959](https://dl.acm.org/doi/10.1145/3589335.3651959)), and I have written bots on the Harmony blockchain in the past. I hold a bachelor’s degree in Mathematics and a master’s degree in Data Science.

* * *

Grant Category:

Other: Analytics - to motivate solvers to utilize CoWAMM liquidity.

* * *

Grant Description:

CoW AMM pools are designed to protect against Loss Versus Rebalancing (LVR) and aim to deliver superior returns to liquidity providers. However, the current level of solver utilization of CoW AMM liquidity in CoW Protocol settlements limits the potential APY and overall success of the product. This grant seeks to address this issue by developing a robust solution to:

1. Quantify Missed Opportunities: Accurately measure the volume and surplus not captured by solvers failing to integrate CoW AMM liquidity effectively.
2. Automate and Scale Analysis: Automate the “trade envy” computation process for multiple token pairs across chains and make results accessible to the product team for informed decision-making.
3. Support Product Success: Provide actionable insights to incentivize solver behavior and drive higher adoption of CoW AMMs, unlocking their full economic potential.

* * *

Grant Goals and Impact:

#### Grant Goals:

1. Accurately quantify missed surplus opportunities for CoW AMM pools to optimize solver integration.
2. Automate weekly reporting for actionable insights.

#### Potential Impact:

1. Higher returns and APY for liquidity providers, improving CoW AMM attractiveness.
2. Increased competitiveness of CoW Protocol through better liquidity utilization.

* * *

Milestones:

These are the milestones to be met:

| Milestone | Due Date | Payment |
| --- | --- | --- |
| Basic Functionality | Feb 22th 2025 | xDai 1250 |
| Extended Functionality | Feb 29nd 2025 | xDai 1250 |
| Deployable Project | March 12th 2025 | xDai 1250 |

Milestone 1

- Basic Calculation Logic for a single CoWAMM pool
- Query Dune data (price and settlement data)
- Query data from node (helper contracts)
- Query caching
- Dashboard to show metrics aggregated on solver-level or pool-level

Milestone 2

- Consider multiple CoWAMM pools for calculation
- Allow configuration for the calculation on different blockchains
- Allow invocation of script to update database and show most recent data on trade envy.

Milestone 3

- Dockerize
- Integrate into existing infrastructure
- Allow weekly incremental data updates using GitHub actions

* * *

Funding Request:

The expected time effort for this project is 75 hours or about 3750 xDai.

#### Justification:

1. Scope and Complexity: The project involves refactoring and extending existing scripts, developing automation pipelines, and scaling to support multiple token pairs and chains. Additionally, to make sure calculations are correct, testing has to be implemented on select settlements.
2. Development and Automation: Funding will cover time and resources to build reliable and automated weekly reporting systems.
3. Impact: The project directly enhances the CoW AMM product by increasing solver adoption, creating value for liquidity providers and the broader CoW Protocol ecosystem.

* * *

Budget Breakdown:

All of the budget will be allocated to the development of the data pipeline.

* * *

Gnosis Chain Address (to receive the grant):

0xb49CaA161850715eba7B9aDfba51BAFF2e9E3252

* * *

Referral:

I am working on this currently together with Felix Leupold

* * *

Terms and Conditions:

By submitting this grant application, I acknowledge and agree to be bound by theCoW DAO Participation Agreement and the CoW Grant Terms and Conditions.

---

<div class="post-metadata">

**Author:** ![mfw78](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/mfw78/32/1598_2.png) [@mfw78](https://forum.cow.fi/u/mfw78)\
**Post date:** [February 28, 2025, 5:23am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/2 "2025-02-28T05:23:49Z")

</div>

Is someone from solver team able to weigh in on this please? @AndreaC / @solver_cow

---

<div class="post-metadata">

**Author:** ![AndreaC](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@AndreaC](https://forum.cow.fi/u/AndreaC)\
**Post date:** [February 28, 2025, 8:46am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/3 "2025-02-28T08:46:15Z")

</div>

I think the work proposed is very important. CoW AMM pools are a relatively new participant in the CoW Protocol: its LPs provide liquidity exclusively to CoW Protocol’s solvers. At the same time, the surplus provided by solvers to the LPs matters in the solvers competition (and hence in determining who wins and the rewards paid out).

Over the years, CoW protocol has developed several metrics to track/measure the quality of execution of users’ trades. However, not all these metrics are appropriate for an AMM pool. The grant aims to overcome this problem by developing a metric to track “how well” solvers and the solvers competition are treating CoW AMM pools. Also, in my view, the methodology proposed is sound.

---

<div class="post-metadata">

**Author:** ![mfw78](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/mfw78/32/1598_2.png) [@mfw78](https://forum.cow.fi/u/mfw78)\
**Post date:** [February 28, 2025, 8:58am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/4 "2025-02-28T08:58:14Z")

</div>

Did you want to be reviewer? 👀 😅

---

<div class="post-metadata">

**Author:** ![AndreaC](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@AndreaC](https://forum.cow.fi/u/AndreaC)\
**Post date:** [February 28, 2025, 9:10am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/5 "2025-02-28T09:10:41Z")

</div>

sure, I can do it! But the grant is based on some initial work by @solver_cow , who may be in a better position to evaluate the grant

---

<div class="post-metadata">

**Author:** ![mfw78](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/mfw78/32/1598_2.png) [@mfw78](https://forum.cow.fi/u/mfw78)\
**Post date:** [February 28, 2025, 9:16am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/6 "2025-02-28T09:16:31Z")

</div>

Cool. In general, I agree with the strong need to quantify and measure the value of CoW AMM to provide clear guidance that may influence resource allocations towards CoW AMM. I signal my support of this grant and am happy to steward on the proviso that @AndreaC or @solver_cow are available to act as reviewer for the milestones.

---

<div class="post-metadata">

**Author:** ![tommel](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tommel](https://forum.cow.fi/u/tommel)\
**Post date:** [March 5, 2025, 4:28pm UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/7 "2025-03-05T16:28:32Z")

</div>

Is there anything you need from my side? @mfw78 @AndreaC

---

<div class="post-metadata">

**Author:** ![mfw78](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/mfw78/32/1598_2.png) [@mfw78](https://forum.cow.fi/u/mfw78)\
**Post date:** [March 5, 2025, 4:40pm UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/8 "2025-03-05T16:40:23Z")

</div>

I think you can move this to snapshot for a vote. @AndreaC / @solver_cow can we please have a responsible person be nominated for reviewer from the solver team? 🙏 I’m happy to nominate myself to steward this grant should it be successful through the Grants Committee voting. Also, kindly when submitting the snapshot, please ensure that it is absolutely in accordance with the template on the forum, and ensure that the link to the T&C / DAO participation agreement is present in the snapshot 🙇‍♂️

---

<div class="post-metadata">

**Author:** ![harisang](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/harisang/32/524_2.png) [@harisang](https://forum.cow.fi/u/harisang)\
**Post date:** [March 6, 2025, 8:57am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/9 "2025-03-06T08:57:44Z")

</div>

I can be the reviewer from the solver team.

---

<div class="post-metadata">

**Author:** ![mfw78](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/mfw78/32/1598_2.png) [@mfw78](https://forum.cow.fi/u/mfw78)\
**Post date:** [March 17, 2025, 11:21am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/10 "2025-03-17T11:21:49Z")

</div>

@tommel Did you want to move this to snapshot?

---

<div class="post-metadata">

**Author:** ![tommel](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tommel](https://forum.cow.fi/u/tommel)\
**Post date:** [March 18, 2025, 7:18pm UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/11 "2025-03-18T19:18:17Z")

</div>

Yes, thank you! I just tried but I need at least 0.01 HERD to create a proposal [GitHub - cowdao-grants/herd-token: Herd token for Grants DAO Governance](https://github.com/cowdao-grants/herd-token)

I don’t think I can obtain it on my own

---

<div class="post-metadata">

**Author:** ![mfw78](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/mfw78/32/1598_2.png) [@mfw78](https://forum.cow.fi/u/mfw78)\
**Post date:** [March 20, 2025, 6:47am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/12 "2025-03-20T06:47:58Z")

</div>

Thanks, we are checking the issues with the snapspace. Can you confirm if the address to which you attempted to create the snapshot from has any xDAI?

---

<div class="post-metadata">

**Author:** ![tommel](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tommel](https://forum.cow.fi/u/tommel)\
**Post date:** [March 20, 2025, 9:00am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/13 "2025-03-20T09:00:28Z")

</div>

Now I have some from the faucet.

---

<div class="post-metadata">

**Author:** ![tommel](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tommel](https://forum.cow.fi/u/tommel)\
**Post date:** [March 24, 2025, 4:57pm UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/14 "2025-03-24T16:57:35Z")

</div>

Any updates on this?

---

<div class="post-metadata">

**Author:** ![harisang](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/harisang/32/524_2.png) [@harisang](https://forum.cow.fi/u/harisang)\
**Post date:** [March 27, 2025, 10:45am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/15 "2025-03-27T10:45:06Z")

</div>

Really sorry for the delay in reviewing this on my end. Will try to catch up and post an update by tomorrow end of day

---

<div class="post-metadata">

**Author:** ![mfw78](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/mfw78/32/1598_2.png) [@mfw78](https://forum.cow.fi/u/mfw78)\
**Post date:** [March 31, 2025, 10:11am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/16 "2025-03-31T10:11:50Z")

</div>

Hi @tommel I think that there were issues with Snapshot whereby they were incorrectly labeling the 0.01 HERD when indeed it is actually 0.01 XDAI that is required. We have recently had other votes be placed in Snapshot by users that do not have HERD so it should indeed work.

---

<div class="post-metadata">

**Author:** ![tommel](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tommel](https://forum.cow.fi/u/tommel)\
**Post date:** [April 5, 2025, 9:45am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/17 "2025-04-05T09:45:49Z")

</div>

Perfect, just put it on snapshot

---

<div class="post-metadata">

**Author:** ![mfw78](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/mfw78/32/1598_2.png) [@mfw78](https://forum.cow.fi/u/mfw78)\
**Post date:** [April 6, 2025, 7:03am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/18 "2025-04-06T07:03:49Z")

</div>

Thanks, hopefully it passes, but generally we discourage grants to be posted that overlap on the weekend for voting as reaching quorum may be difficult. I’ve pinged the rest of the grants committee to weigh in and hopefully we can achieve quorum.

---

<div class="post-metadata">

**Author:** ![tommel](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tommel](https://forum.cow.fi/u/tommel)\
**Post date:** [April 6, 2025, 7:27am UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/19 "2025-04-06T07:27:02Z")

</div>

Sorry for the disturbance. Wasnt aware of the short deadline.

---

<div class="post-metadata">

**Author:** ![Chim9](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/chim9/32/417_2.png) [@Chim9](https://forum.cow.fi/u/Chim9)\
**Post date:** [April 8, 2025, 1:13pm UTC](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836/20 "2025-04-08T13:13:18Z")

</div>

Thanks for your proposal!

The vote passed : [https://snapshot.box/#/s:cowgrants.eth/proposal/0xcbb1e440d60b1f8db9936ac78a3fdf15ec3c62f592f4a16c1970480cf76e006b](https://snapshot.box/#/s:cowgrants.eth/proposal/0xcbb1e440d60b1f8db9936ac78a3fdf15ec3c62f592f4a16c1970480cf76e006b)

[Next page](https://forum.cow.fi/t/grant-application-data-pipeline-for-calculating-trade-envy-of-cowamm-pools/2836.md?page=2)
