Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CoW AMM] Metric for daily invariant growth (surplus) per $100 #23

Merged
merged 7 commits into from
Sep 17, 2024

Conversation

fleupold
Copy link
Contributor

As an additional metric next to "growth of 10k" we want to compare the invariance growth of CoW AMMs with the ones from Uniswap.

For CoW AMM this is equal to surplus, for Uniswap it's equal to the swap fee amount (volume * 0,3%). Both are normalized over TVL in order to have a reasonable comparison.

This query adds the comparison for CoW AMM.

Test Plan

Comparing https://balancer.fi/pools/ethereum/cow/0xf08d4dea369c456d26a3168ff0024b904f2d8b91 with https://dune.com/queries/4059213 for a rough sanity check (values cannot match exactly because balancer uses a different price feed)

@fleupold fleupold changed the title [CoW AMM] Metric for daily invarian growth (surplsu) per [CoW AMM] Metric for daily invariant growth (surplus) per Sep 10, 2024
@fleupold fleupold changed the title [CoW AMM] Metric for daily invariant growth (surplus) per [CoW AMM] Metric for daily invariant growth (surplus) per $100 Sep 10, 2024
),

-- Computes the token balance changes of the relevant token per transaction
reserves_delta as (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the query can be substitutes by calling the base query.

The base query also tries to take care of

  • liquidity injections
  • deposits and withdrawals

If it is actually this easy, the simplifications should be added to the base query as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which base query do you mean exactly? I created #27 (but am not aware of an existing one)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant query 3968186, which is currently used for dashboards. It is not currently part of this repo.

@fleupold fleupold mentioned this pull request Sep 10, 2024
@fleupold fleupold force-pushed the cowamm/surplus_growth_cow branch from 65e465b to 5c0690a Compare September 10, 2024 18:34
@fleupold fleupold merged commit 784046e into main Sep 17, 2024
1 check passed
@fleupold fleupold deleted the cowamm/surplus_growth_cow branch September 17, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants