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

Add PancakeSwapX on Ethereum to Dex Trades #7383

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

Conversation

chef-seaweed
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:

[...]


quick links for more information:

@github-actions github-actions bot marked this pull request as draft December 25, 2024 10:26
@github-actions github-actions bot added WIP work in progress dbt: dex covers the DEX dbt subproject labels Dec 25, 2024
@chef-seaweed
Copy link
Contributor Author

chef-seaweed commented Dec 26, 2024

Hi @Hosuke @jeff-dude Got this error when running dbt-test: Failure in test dbt_utils_unique_combination_of_columns_pancakeswap_v2_ethereum_base_trades_tx_hash__evt_index (models/trades/ethereum/_schema.yml). Any suggestions how this can be resolved? Thanks 🙏
Screenshot 2024-12-26 at 11 04 12 AM

Edit: Nvm turns out there were some duplicated combinations of tx_hash_ + evt_index. Fixed now thanks.

@chef-seaweed chef-seaweed marked this pull request as ready for review December 26, 2024 05:25
@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Dec 26, 2024
@Hosuke Hosuke self-assigned this Dec 26, 2024
Comment on lines 47 to 50
select * from {{ source('tokens', 'transfers') }}
where blockchain = 'ethereum'
and block_date >= date '2024-09-20'
and tx_hash in (select evt_tx_hash from {{ source('pancakeswap_ethereum', 'ExclusiveDutchOrderReactor_evt_Fill') }})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think we can make this part a CTE with incremental filters before left join?

Copy link
Contributor Author

@chef-seaweed chef-seaweed Dec 27, 2024

Choose a reason for hiding this comment

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

Do you mean like this?

with transfer as (
  select * from {{ source('tokens', 'transfers') }}
  where blockchain = 'ethereum'
  and block_date >= date '2024-09-20' 
  and tx_hash in (select evt_tx_hash from {{ source('pancakeswap_ethereum', 'ExclusiveDutchOrderReactor_evt_Fill') }})
  {% if is_incremental() %}
  WHERE {{ incremental_predicate('a.evt_block_time') }}
  {% endif %}
)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Exactly.

@0xRobin 0xRobin marked this pull request as draft December 29, 2024 10:25
@github-actions github-actions bot added WIP work in progress and removed ready-for-review this PR development is complete, please review labels Dec 29, 2024
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 WIP work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants