refactor: share EVM chain list across dex and gas sector spells#9897
Merged
Conversation
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>
jeff-dude
marked this pull request as ready for review
July 17, 2026 19:38
Member
|
@cursor move each shared macro into respective subproject (dex, hourly) macros directory directly (no need for shared naming standard) |
|
Done — moved the two macros into each sub-project's own
Re-compiled |
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
approved these changes
Jul 17, 2026
Member
|
@cursor review |
There was a problem hiding this comment.
✅ 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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 bydex.trades(union) anddex_evm.trades(expose_spellspost_hook)gas_evm_chains()— consumed bygas.fees(union of the EVM subset,tronappended once at the top of the model) andgas_evm.fees(expose_spellspost_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, andgas_evm_fees(same chains, same order —gas_feeshad a minorlinea/lensordering inconsistency between its inlineset chainsandexpose_spellsargs; the macro produces the alphabetical order theexpose_spellslist already used).Verified with
dbt compile --select dex_trades dex_evm_tradesin thedexproject anddbt compile --select gas_fees gas_evm_feesinhourly_spellbook.quick links for more information:
Slack Thread