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

fix op:OATH/WETH pool liquidity #47

Closed
mendesfabio opened this issue Nov 28, 2023 · 5 comments
Closed

fix op:OATH/WETH pool liquidity #47

mendesfabio opened this issue Nov 28, 2023 · 5 comments
Assignees

Comments

@mendesfabio
Copy link
Member

Context

Beethoven says TVL is $870k but on Dune it is $13M.

@mendesfabio mendesfabio changed the title fix OATH/WETH pool liquidity fix op:OATH/WETH pool liquidity Nov 28, 2023
@viniabussafi
Copy link
Member

viniabussafi commented Nov 30, 2023

Been working on an improvement for the liquidity spell on this query.
Basically, we are exposed to outliers in pricing information that comes from prices.usd and dex.prices. This tends to happen on tokens with less volume of trades.
Therefore, I have created a whitelist for tokens considered as pricing assets (e.g. WETH, USDC, DAI, USDT and a few others). The idea is to have the pool liquidity for weighted pools calculated, whenever possible, based on the balance and price of these pricing assets. This logic can be found on the pool_liquidity_estimates and pool_liquidity_estimates_2 CTEs and accounts for the following cases:

  • Pool with only one pricing asset,
  • Pool with more than one pricing asset
  • Pool with no pricing asset

From my initial analysis, this would have a marginal impact on most chains, with the only exception being optimism, due to the case mentioned in this issue.
I will follow-up on this task by running a PR on the spellbook and checking its impact on our liquidity data.
This PR will be combined with #44, that is to create a macro for the liquidity spells.

@mendesfabio
Copy link
Member Author

that's an interesting approach but another thing we should also do is simply report these outliers to Dune/Coinpaprika. you can send them links or screenshots of the price compared against other platforms (Coingecko)

@viniabussafi
Copy link
Member

Reference for token whitelist file on the balancer namespace on spellbook: https://github.com/duneanalytics/spellbook/blob/main/models/oneinch/oneinch_contract_addresses.sql

Will mention distortion on OATH price on my PR and then reference it on dune discord

@viniabussafi
Copy link
Member

PR created, waiting for review.

@viniabussafi
Copy link
Member

PR merged and issue fixed

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

No branches or pull requests

2 participants