Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bridges of LI.FI across chains, the contract is LiFiDiamond_v2 #7172

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

lequangphu
Copy link
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:

Extract bridge data from event LiFiDiamond_v2_evt_LiFiTransferStarted on each chain, then union across chains.


quick links for more information:

@lequangphu lequangphu marked this pull request as draft November 22, 2024 08:29
@jeff-dude jeff-dude added WIP work in progress dbt: daily covers the Daily dbt subproject labels Nov 25, 2024
@jeff-dude jeff-dude self-assigned this Nov 25, 2024
@jeff-dude
Copy link
Member

before we dig into the failing test, i think we need to redesign this pipeline a bit.

  • flip your materialization strategy approach -- i.e. materialize each chain incrementally, then have the crosschain be a view on top
  • looks like the code is the same per chain -- in this case, i'd use a dbt macro for the logic and call the macro for each chain while passing in the blockchain parameter to differentiate. there are tons of examples in spellbook to use as reference, one to search could be the uniswap models in dex subproject (but plenty others too!)
  • when joining from decoded to base table to get additional columns, lets use this shared macro. an example to call the macro is here
  • when using the if is incremental logic, let's use the latest macro approach like here rather than hardcode last 7 days
  • for incremental chain models, i would expect config to contain all of this
  • looks like you removed the surrogate key logic, i'd put that back in and use as unique key. then update the schema yml to run unique test on this column, not the combination of columns that make up the surrogate key

let's leave it at that for now, and revisit once all this in place 🙏

@lequangphu
Copy link
Contributor Author

before we dig into the failing test, i think we need to redesign this pipeline a bit.

  • flip your materialization strategy approach -- i.e. materialize each chain incrementally, then have the crosschain be a view on top
  • looks like the code is the same per chain -- in this case, i'd use a dbt macro for the logic and call the macro for each chain while passing in the blockchain parameter to differentiate. there are tons of examples in spellbook to use as reference, one to search could be the uniswap models in dex subproject (but plenty others too!)
  • when joining from decoded to base table to get additional columns, lets use this shared macro. an example to call the macro is here
  • when using the if is incremental logic, let's use the latest macro approach like here rather than hardcode last 7 days
  • for incremental chain models, i would expect config to contain all of this
  • looks like you removed the surrogate key logic, i'd put that back in and use as unique key. then update the schema yml to run unique test on this column, not the combination of columns that make up the surrogate key

let's leave it at that for now, and revisit once all this in place 🙏

thanks, i will update the pr based on your recommendation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dbt: daily covers the Daily dbt subproject WIP work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants