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

balances upgrade + daily aggregation with forward fill #5464

Merged
merged 18 commits into from
Mar 1, 2024

Conversation

0xRobin
Copy link
Collaborator

@0xRobin 0xRobin commented Feb 28, 2024

  • rename some of the columns in the balances schema
  • addition of daily aggregation with forward fill

@jeff-dude jeff-dude added WIP work in progress dune team created by dune team labels Feb 28, 2024
@0xRobin 0xRobin marked this pull request as ready for review February 29, 2024 14:25
@0xRobin 0xRobin added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Feb 29, 2024
@0xRobin
Copy link
Collaborator Author

0xRobin commented Feb 29, 2024

example query: https://dune.com/queries/3475840/5841282

Copy link
Contributor

@aalan3 aalan3 left a comment

Choose a reason for hiding this comment

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

Looks great! had a couple of comments. Can you also update the description with a summary of the changes and PR name for posterity

macros/models/_sector/tokens/balances_daily.sql Outdated Show resolved Hide resolved
-- TODO: should not be hardcoded
WHEN type = 'native' THEN erc20_tokens.contract_address = 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
WHEN token_standard = 'native' THEN erc20_tokens.contract_address = 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Copy link
Contributor

Choose a reason for hiding this comment

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

This will not work for Polygon I think, we should pass this in instead.

Copy link
Collaborator Author

@0xRobin 0xRobin Feb 29, 2024

Choose a reason for hiding this comment

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

I have only changed the column name here. 🤔
What exactly should we pass in?

Copy link
Contributor

Choose a reason for hiding this comment

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

We use this for polygon https://github.com/duneanalytics/spellbook/blob/main/tokens/models/tokens/polygon/tokens_polygon_erc20.sql#L14

Most other L2s use ETH, we could actually also just pass in the the symbol and the decimal (it seems to be 8 for BNB?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah ok I'll add it to the schema fix macro, ideally we would fill these values already in the raw table (instead of the current null values)

@0xRobin 0xRobin changed the title balances smol refactor balances upgrade + daily aggregation with forward fill Feb 29, 2024
@aalan3 aalan3 merged commit a183d16 into duneanalytics:main Mar 1, 2024
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2024
@0xRobin 0xRobin deleted the balances-refact branch May 20, 2024 10:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dune team created by dune team ready-for-review this PR development is complete, please review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants