-
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
Gains Network Perpetual for Base #7437
Gains Network Perpetual for Base #7437
Conversation
post_hook='{{ expose_spells(\'["base"]\', | ||
"project", | ||
"gains_network", | ||
\'["princi"]\') }}' |
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.
Please remember to apply the new format to post_hook.
blockchain | ||
,block_date | ||
,block_month | ||
,block_time |
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.
Please be consistent in space/tab
indentation.
blockchain | |
,block_date | |
,block_month | |
,block_time | |
blockchain | |
,block_date | |
,block_month | |
,block_time |
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.
Maybe you can fix the tabs here.
...k/models/_sector/perpetual/projects/gains_network/gains_network_v1_base_perpetual_trades.sql
Outdated
Show resolved
Hide resolved
...k/models/_sector/perpetual/projects/gains_network/gains_network_v1_base_perpetual_trades.sql
Show resolved
Hide resolved
...k/models/_sector/perpetual/projects/gains_network/gains_network_v1_base_perpetual_trades.sql
Outdated
Show resolved
Hide resolved
...k/models/_sector/perpetual/projects/gains_network/gains_network_v1_base_perpetual_trades.sql
Outdated
Show resolved
Hide resolved
tx."to" AS tx_to, | ||
perps.evt_index | ||
FROM perps | ||
INNER JOIN delta_prod.base.transactions AS tx |
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.
We may need to introduece a CTE for transactions table with incremental filters before inner join.
source()
syntax is needed here as well.
...k/models/_sector/perpetual/projects/gains_network/gains_network_v1_base_perpetual_trades.sql
Show resolved
Hide resolved
...k/models/_sector/perpetual/projects/gains_network/gains_network_v1_base_perpetual_trades.sql
Show resolved
Hide resolved
...ts/hourly_spellbook/models/_sector/perpetual/projects/gains_network/gains_network_schema.yml
Outdated
Show resolved
Hide resolved
...book/models/_sector/perpetual/projects/gains_network/gains_network_base_perpetual_trades.sql
Outdated
Show resolved
Hide resolved
...book/models/_sector/perpetual/projects/gains_network/gains_network_base_perpetual_trades.sql
Outdated
Show resolved
Hide resolved
tx."to" AS tx_to, | ||
perps.evt_index | ||
FROM perps | ||
INNER JOIN {{ source('base', 'transactions') }} AS tx |
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.
We can make a transactions_filtered
CTE with incremental filter first for fast loading.
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.
After schema fixed, you may consider adding gains_network_perpetual_trades
into perpetual_trades
:
https://github.com/duneanalytics/spellbook/blob/main/dbt_subprojects/hourly_spellbook/models/_sector/perpetual/perpetual_trades.sql
blockchain | ||
,block_date | ||
,block_month | ||
,block_time |
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.
Maybe you can fix the tabs here.
schema = 'gains_network_perpetual_trades', | ||
alias = 'perpetual_trades', |
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.
Please fix the schema:
schema = 'gains_network_perpetual_trades', | |
alias = 'perpetual_trades', | |
schema = 'gains_network', | |
alias = 'perpetual_trades', |
@@ -0,0 +1,221 @@ | |||
{{ config( | |||
schema = 'gains_network_base', |
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.
schema = 'gains_network_base', | |
schema = 'gains_network_v1_base', |
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.
Please rename this file to match schema
+alias
:
gains_network_perpetual_trades.sql
...ts/hourly_spellbook/models/_sector/perpetual/projects/gains_network/gains_network_schema.yml
Show resolved
Hide resolved
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.
LGTM.✅
Thank you @PatelPrinci
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: