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

optimism: uniswap pools dex balances #7271

Closed
wants to merge 30 commits into from

Conversation

Jason4276
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:

@0xRobin 0xRobin added WIP work in progress dbt: daily covers the Daily dbt subproject labels Dec 10, 2024
@0xRobin 0xRobin marked this pull request as draft December 10, 2024 12:18
@jeff-dude jeff-dude self-assigned this Dec 10, 2024
@jeff-dude jeff-dude added in review Assignee is currently reviewing the PR and removed WIP work in progress labels Dec 10, 2024
@jeff-dude jeff-dude added the WIP work in progress label Dec 10, 2024
@jeff-dude jeff-dude changed the title uniswap dex balances optimism: uniswap pools dex balances Dec 11, 2024
@jeff-dude jeff-dude requested a review from 0xRobin December 17, 2024 18:51
@jeff-dude jeff-dude assigned 0xRobin and unassigned jeff-dude Dec 17, 2024
@Jason4276 Jason4276 marked this pull request as ready for review December 19, 2024 10:06
@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Dec 19, 2024
@0xRobin
Copy link
Collaborator

0xRobin commented Dec 20, 2024

please merge in main to resolve the compile issue.

@0xRobin 0xRobin marked this pull request as draft December 20, 2024 09:50
@github-actions github-actions bot added WIP work in progress and removed ready-for-review this PR development is complete, please review labels Dec 20, 2024
Comment on lines 49 to 52
FROM
op_pools p
LEFT JOIN
filtered_balances b ON p.pool_address = b.pool_address
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
FROM
op_pools p
LEFT JOIN
filtered_balances b ON p.pool_address = b.pool_address
FROM
filtered_balances b
RIGHT JOIN
op_pools p ON p.pool_address = b.pool_address

Copy link
Member

Choose a reason for hiding this comment

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

thank you for the patience and iterating on changes to improve the spell. one last request, can we try flipping the read table and right join pools, since balances is larger table? just curious to see impact on run time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I've updated the query to use a RIGHT JOIN with filtered_balances as the read table and op_pools on the right. I'll test the runtime and see if it improves performance.

@jeff-dude
Copy link
Member

coming back with another suggestion. you can try in a fresh PR, if you'd like, to keep things clean. i notice you're building out various DEXs to fit this similar design pattern. can we try an approach to read from dex.trades with some filters:

  • chains interested in
  • where pool contains OP token
  • ...whatever else you can think to filter

then pass that output into our generic balances macro, like this PR?
https://github.com/duneanalytics/spellbook/pull/7411/files#diff-9c62c63ab7a828b94dff4bb17dfb6aa19381f6dfcd838aa47397886ede38e1eb

i think in the long run, this could save you time across various DEXs. the question will be how that performs, as you could be pulling many more pools than you do here.

@jeff-dude
Copy link
Member

closing in favor of new PR

@jeff-dude jeff-dude closed this Jan 15, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dbt: daily covers the Daily dbt subproject in review Assignee is currently reviewing the PR WIP work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants