Skip to content

Conversation

@santinoYoung
Copy link

@santinoYoung santinoYoung commented Dec 16, 2025

Adds daily liquidity (TVL) abstraction for DeSyn protocol on 7 major chains:

  • Ethereum

  • Arbitrum

  • Scroll

  • Linea

  • BNB Chain

  • Hemi

  • Plume

  • Extracts Smart Pool addresses from official CRPFactory NewCrp events

  • Daily TVL calculated from erc20.view_token_balances_daily * prices.usd

  • Incremental materialized view for performance

Objective: To display the TVL of all chains.

Other chains (Bitlayer, zkLink Nova, AIlayer, Core, Goat etc.) omitted pending full raw logs support in dex subproject.

Ready for merge – thanks!

@cursor
Copy link

cursor bot commented Dec 16, 2025

PR Summary

Introduce per-chain DeSyn TVL models (Arbitrum, BNB, Ethereum, Hemi, Linea, Plume, Scroll) and an aggregated daily liquidity table with incremental processing.

  • Desyn liquidity models (v1):
    • Add per-chain models: desyn_arbitrum_liquidity_v1, desyn_bnb_liquidity_v1, desyn_ethereum_liquidity_v1, desyn_hemi_liquidity_v1, desyn_linea_liquidity_v1, desyn_plume_liquidity_v1, desyn_scroll_liquidity_v1.
    • Extract pool addresses from chain logs via topic0 filter; compute daily USD liquidity from erc20.view_token_balances_daily joined to prices.usd.
    • Incremental (7-day window), unique_key on [day, pool_address], outputs include blockchain, pool_address, protocol_liquidity_usd, version.
  • Aggregated liquidity:
    • New desyn_liquidity unions all per-chain models and sums protocol_liquidity_usd by day, blockchain, version; incremental and partitioned by day with unique_key [day, blockchain, version].
  • Schema:
    • Add schema.yml with descriptions and dbt_utils.unique_combination_of_columns test for desyn_liquidity; basic column tests for Ethereum model.

Written by Cursor Bugbot for commit 9e9aacd. Configure here.

@github-actions
Copy link

github-actions bot commented Dec 16, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@github-actions github-actions bot marked this pull request as draft December 16, 2025 03:50
@github-actions github-actions bot added WIP work in progress dbt: dex covers the DEX dbt subproject labels Dec 16, 2025
@santinoYoung santinoYoung marked this pull request as ready for review December 16, 2025 06:41
@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Dec 16, 2025
@santinoYoung
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dbt: dex covers the DEX dbt subproject ready-for-review this PR development is complete, please review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant