Skip to content

Conversation

@alicecha
Copy link
Contributor

@alicecha alicecha commented Jan 2, 2026

Thank you for contributing to Spellbook 🪄

Please open the PR in draft and mark as ready when you want to request a review.

Description:

[...]


quick links for more information:

@github-actions github-actions bot added WIP work in progress dbt: dex covers the DEX dbt subproject labels Jan 2, 2026
@alicecha alicecha marked this pull request as ready for review January 5, 2026 12:57
@cursor
Copy link

cursor bot commented Jan 5, 2026

PR Summary

Introduces chain-scoped, incremental daily token volume computation and a unified cross-chain view.

  • New incremental dex_<chain>_token_volumes_daily models (e.g., arbitrum, base, ethereum, polygon, zksync, etc.) aggregating bought/sold flows into daily volume_raw, volume, and volume_usd
  • Adds data tests in _schema.yml for each chain ensuring uniqueness on (blockchain, token_address, symbol, block_date)
  • New unioned view dex_token_volumes_daily and alias view tokens/dex_volume_day exposing all chains
  • Minor _schema.yml cleanups (newline/indent fixes)
  • Sets vars.dev_dates: true in dbt_project.yml to limit scan in dev mode

Written by Cursor Bugbot for commit 88755c6. Configure here.

@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Jan 5, 2026
@alicecha alicecha requested a review from 0xBoxer January 5, 2026 12:57
@alicecha
Copy link
Contributor Author

alicecha commented Jan 5, 2026

Ready for review - data quality checks here: https://linear.app/dune/issue/CUR2-1199/create-dextoken-volume-day-table-for-consensys

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Comment @cursor review or bugbot run to trigger another review on this PR

@alicecha alicecha requested a review from a team January 5, 2026 15:49
Copy link
Contributor

@tomfutago tomfutago left a comment

Choose a reason for hiding this comment

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

hey @alicecha - just added a few minor comments

Comment on lines 82 to 84
, CASE WHEN bought_volume_raw_sum IS NULL AND sold_volume_raw_sum IS NULL THEN NULL
ELSE COALESCE(bought_volume_raw_sum, 0) + COALESCE(sold_volume_raw_sum, 0)
END AS volume_raw
Copy link
Contributor

Choose a reason for hiding this comment

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

just this instead of CASE..WHEN?

NULLIF(COALESCE(bought_volume_raw_sum, 0) + COALESCE(sold_volume_raw_sum, 0), 0)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The thing is I would like it to default to NULL if both supply and bought are NULL

Copy link
Member

@jeff-dude jeff-dude left a comment

Choose a reason for hiding this comment

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

proactive approval, but agree with tom feedback on macro usage.

@jeff-dude jeff-dude added in review Assignee is currently reviewing the PR and removed ready-for-review this PR development is complete, please review labels Jan 6, 2026
@alicecha alicecha merged commit 0042496 into main Jan 6, 2026
5 of 6 checks passed
@alicecha alicecha deleted the CUR2-1199-dex-daily-volume branch January 6, 2026 08:03
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dbt: dex covers the DEX dbt subproject in review Assignee is currently reviewing the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants