duneanalytics / spellbook

SQL views for Dune
Other
1.19k stars 1.14k forks source link

Missing CLPool Contracts for Velodrome_v2 on Optimism in `dex.trades` table #6828

Open IvyLabs-Analytics opened 2 months ago

IvyLabs-Analytics commented 2 months ago

Description

I noticed that there is no data for Velodrome_v2 CLPools, which are their concentrated liquidity pools (an example: 0x478946bcd4a5a22b316470f5486fafb928c0ba25) on Optimism under dex.trades. Here is a sample dune query: https://dune.com/queries/4098255.

Current behavior

Currently that pool/contract address is missing in the table. Other CLPool contracts are also missing. The velodrome_v2_optimism.CLPool_evt_Swap and velodrome_v2_optimism.CLFactory_evt_PoolCreated tables are missing here: https://github.com/duneanalytics/spellbook/blob/main/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql

Expected behavior

Should be providing information on the current volumes (amount_usd) or token bought/sold.

Possible solution

Add CLFactory and CLPool to spellbook. The contract is similar to Uniswap V3. For the purposes of tracking Swap events, it’s identical. It’s about a 95% fork. I believe there’s a slightly different abi for slot0, which omits only the protocolFees field. There’s additional functionality for staking in their ve(3,3) gauges, but everything else is identical like their Mints, Burns, Swaps, etc.

jeff-dude commented 1 month ago

hi @IvyLabs-Analytics -- thank you for raising. we don't proactively add DEXs on our side v often. i would suggest finding a wizard in the community who is willing to help, if you are not able to add yourself

IvyLabs-Analytics commented 1 month ago

Hey @jeff-dude, thanks for the info! I’m a bit confused, though, because multiple members of Dune support directed me here for this issue. Is there no one from the Dune team responsible for managing DEX contract integrations for Spellbook?

Also, just to clarify—Velodrome is already in Spellbook. The issue is that their new concentrated liquidity pools aren’t included in the current code. It’s the same structure as Aerodrome CL Pools on Base, which are working well in Spellbook.

jeff-dude commented 1 month ago

i can leave this open to track addition, but to your question, we as spellbook maintainers don't proactively add all contracts to dex.trades. i'm happy to help get it built once PR is initiated, but we need someone to help take those steps.