-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
creating EVM net transfers #7512
base: main
Are you sure you want to change the base?
Conversation
dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/_schema.yml
Outdated
Show resolved
Hide resolved
…_schema.yml Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com>
Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com>
Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com>
Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com>
Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com>
Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com>
Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com>
…espective schema, updated tokens_net_transfers_daily_address.sql and tokens_net_transfers_daily.sql to include all chains I made changes for
…_transfers_arbitrum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking pretty gooood 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly leaving comments on arbitrum only (and evm macro), but look to apply universally 🙏
...s/models/transfers_and_balances/arbitrum/tokens_arbitrum_net_value_transfers_asset_daily.sql
Outdated
Show resolved
Hide resolved
...s/models/transfers_and_balances/arbitrum/tokens_arbitrum_net_value_transfers_asset_daily.sql
Outdated
Show resolved
Hide resolved
|
||
{% ############################################################################################ %} | ||
|
||
{% macro evm_net_value_transfers_asset_daily(blockchain) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% macro evm_net_value_transfers_asset_daily(blockchain) %} | |
{% macro evm_net_transfers_daily_asset(blockchain) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we keep this naming standard, then use net_value_transferred_amount_usd
as the final column name? that way we use the naming standard introduced in PRD for actual column values, then maintain consistency with other macro / tables at table level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean instead of filtered_net_transfer_amount_usd
from the macro we use net_value_transferred_amount_usd
as the name yeah?
dbt_subprojects/tokens/models/transfers_and_balances/_schema.yml
Outdated
Show resolved
Hide resolved
dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/_schema.yml
Outdated
Show resolved
Hide resolved
dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/_schema.yml
Outdated
Show resolved
Hide resolved
, address | ||
, sum(coalesce(transfer_amount_usd_sent, 0)) as transfer_amount_usd_sent | ||
, sum(coalesce(transfer_amount_usd_received, 0)) as transfer_amount_usd_received | ||
, sum(coalesce(transfer_amount_usd_received, 0)) + sum(coalesce(transfer_amount_usd_sent, 0)) as net_transfer_amount_usd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, sum(coalesce(transfer_amount_usd_received, 0)) + sum(coalesce(transfer_amount_usd_sent, 0)) as net_transfer_amount_usd | |
, sum(coalesce(transfer_amount_usd_received, 0)) + sum(coalesce(transfer_amount_usd_sent, 0)) as net_value_transferred_amount_usd |
, sum(transfer_amount_usd_sent) as transfer_amount_usd_sent | ||
, sum(transfer_amount_usd_received) as transfer_amount_usd_received | ||
-- , sum(abs(transfer_amount_usd_sent)) + sum(abs(transfer_amount_usd_received)) as transfer_amount_usd | ||
, sum(net_transfer_amount_usd) as net_transfer_amount_usd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, sum(net_transfer_amount_usd) as net_transfer_amount_usd | |
, sum(net_value_transferred_amount_usd) as net_value_transferred_amount_usd |
from | ||
net_transfers | ||
where | ||
net_transfer_amount_usd > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
net_transfer_amount_usd > 0 | |
net_value_transferred_amount_usd > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here the filter won't work because we changed the variable from , sum(net_transfer_amount_usd) as net_value_transferred_amount_usd
in the select statement so the where
filter would not understand net_value_transferred_amount_usd > 0
, Could we instead try this after the group by clause?
HAVING
sum(net_transfer_amount_usd) > 0
…er in schema for each chain
Thank you for contributing to Spellbook 🪄
Please open the PR in draft and mark as ready when you want to request a review.
Description:
[...]
Updated 7 files for net transfers
quick links for more information: