Skip to content

refactor: share EVM chain list across dex and gas sector spells#9897

Merged
jeff-dude merged 2 commits into
mainfrom
cursor/universal-evm-chains-list-d544
Jul 17, 2026
Merged

refactor: share EVM chain list across dex and gas sector spells#9897
jeff-dude merged 2 commits into
mainfrom
cursor/universal-evm-chains-list-d544

Conversation

@0xBoxer

@0xBoxer 0xBoxer commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing to Spellbook 🪄

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

Description:

Follow-up to #9895 addressing @jeff-dude's review note that the EVM chain list ends up defined in two paired sector models, which is easy to miss when adding a new chain.

Extracts the chain lists into two shared macros under dbt_macros/shared/:

  • dex_evm_chains() — consumed by dex.trades (union) and dex_evm.trades (expose_spells post_hook)
  • gas_evm_chains() — consumed by gas.fees (union of the EVM subset, tron appended once at the top of the model) and gas_evm.fees (expose_spells post_hook)

After this, adding or removing an EVM chain for either sector is a one-line change in the macro instead of a coordinated edit across both models.

Compiled outputs are unchanged for dex_trades, dex_evm_trades, gas_fees, and gas_evm_fees (same chains, same order — gas_fees had a minor linea/lens ordering inconsistency between its inline set chains and expose_spells args; the macro produces the alphabetical order the expose_spells list already used).

Verified with dbt compile --select dex_trades dex_evm_trades in the dex project and dbt compile --select gas_fees gas_evm_fees in hourly_spellbook.


quick links for more information:

Slack Thread

Open in Web Open in Cursor 

Extract the hardcoded EVM chain lists into two shared macros so the
sector base model and the corresponding _evm compatibility view stay
in sync:

- dex_evm_chains() -> used by dex.trades and dex_evm.trades
- gas_evm_chains() -> used by gas.fees (plus tron) and gas_evm.fees

Follow-up to #9895 addressing the review note about the chain list
being duplicated across paired sector models.

Co-authored-by: 0xBoxer <0xBoxer@users.noreply.github.com>
@github-actions github-actions Bot added WIP work in progress dbt: dex covers the DEX dbt subproject dbt: hourly covers the hourly dbt subproject labels Jul 17, 2026
@jeff-dude
jeff-dude marked this pull request as ready for review July 17, 2026 19:38
@github-actions github-actions Bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Jul 17, 2026
@jeff-dude

Copy link
Copy Markdown
Member

@cursor move each shared macro into respective subproject (dex, hourly) macros directory directly (no need for shared naming standard)

@cursor

cursor Bot commented Jul 17, 2026

Copy link
Copy Markdown

Done — moved the two macros into each sub-project's own macros/ directory:

  • dbt_macros/shared/dex_evm_chains.sqldbt_subprojects/dex/macros/dex_evm_chains.sql
  • dbt_macros/shared/gas_evm_chains.sqldbt_subprojects/hourly_spellbook/macros/gas_evm_chains.sql

Re-compiled dex_trades / dex_evm_trades in the dex project and gas_fees / gas_evm_fees in hourly_spellbook — both resolve the macros from the sub-project macros/ path and produce the same compiled SQL as before (1817-line dex_trades, 1777-line gas_fees).

Open in Web Open in Cursor 

Per review, dex_evm_chains lives with the dex sub-project and
gas_evm_chains with hourly_spellbook, instead of dbt_macros/shared.

Co-authored-by: 0xBoxer <0xBoxer@users.noreply.github.com>
@jeff-dude jeff-dude self-assigned this Jul 17, 2026
@jeff-dude jeff-dude added ready-for-merging and removed ready-for-review this PR development is complete, please review labels Jul 17, 2026
@jeff-dude

Copy link
Copy Markdown
Member

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

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

Reviewed by Cursor Bugbot for commit 33c4fff. Configure here.

@jeff-dude
jeff-dude merged commit 35c9da7 into main Jul 17, 2026
13 checks passed
@jeff-dude
jeff-dude deleted the cursor/universal-evm-chains-list-d544 branch July 17, 2026 20:25
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 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 dbt: hourly covers the hourly dbt subproject ready-for-merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants