-
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
initiate eigenlayer project and eigenlayer source, add v2_withdrawal_queued_flattened data model #7622
Open
bowenli86
wants to merge
4
commits into
duneanalytics:main
Choose a base branch
from
bowenli86:withdrawalq
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
initiate eigenlayer project and eigenlayer source, add v2_withdrawal_queued_flattened data model #7622
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
dbt_subprojects/daily_spellbook/models/eigenlayer/eigenlayer_schema.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: v2_withdrawal_queued_flattened | ||
meta: | ||
blockchain: ethereum | ||
sector: restaking | ||
contributors: bowenli | ||
config: | ||
tags: ['eigenlayer', 'restaking', 'withdrawal'] | ||
description: > | ||
FlattenedV2 withdrawal queued events from EigenLayer | ||
columns: | ||
- &evt_block_time | ||
name: evt_block_time | ||
description: 'Block time in UTC' | ||
- &evt_block_number | ||
name: evt_block_number | ||
description: 'Block Number' | ||
- &evt_tx_hash | ||
name: evt_tx_hash | ||
description: 'Tx Hash' | ||
- &evt_index | ||
name: evt_index | ||
description: "Event index" | ||
- &withdrawalRoot | ||
name: withdrawalRoot | ||
description: "Withdrawal hash root" | ||
- &strategy | ||
name: strategy | ||
description: "Strategy to withdraw from" | ||
- &share | ||
name: share | ||
description: "Share of the withdrawal" |
51 changes: 51 additions & 0 deletions
51
dbt_subprojects/daily_spellbook/models/eigenlayer/v2_withdrawal_queued_flattened.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{{ | ||
config( | ||
schema = 'eigenlayer', | ||
alias = 'v2_withdrawal_queued_flattened', | ||
post_hook='{{ expose_spells(\'["ethereum"]\', | ||
"project", | ||
"eigenlayer", | ||
\'["bowenli"]\') }}' | ||
) | ||
}} | ||
|
||
|
||
WITH | ||
parsed_data AS ( | ||
SELECT | ||
evt_tx_hash, | ||
evt_index, | ||
evt_block_time, | ||
evt_block_number, | ||
withdrawalRoot, | ||
JSON_PARSE(withdrawal) AS parsed_withdrawal | ||
FROM | ||
{{ source('eigenlayer_ethereum', 'DelegationManager_evt_WithdrawalQueued') }} | ||
) | ||
SELECT | ||
t.evt_tx_hash, | ||
t.evt_index, | ||
t.evt_block_time, | ||
t.evt_block_number, | ||
t.withdrawalRoot, | ||
u.strategy, | ||
v.share | ||
FROM | ||
parsed_data AS t | ||
CROSS JOIN UNNEST ( | ||
TRY_CAST( | ||
JSON_EXTRACT(parsed_withdrawal, '$.strategies') AS ARRAY(VARCHAR) | ||
) | ||
) | ||
WITH | ||
ORDINALITY AS u (strategy, ordinality) | ||
CROSS JOIN UNNEST ( | ||
TRY_CAST( | ||
JSON_EXTRACT(parsed_withdrawal, '$.shares') AS ARRAY(VARCHAR) | ||
) | ||
) | ||
WITH | ||
ORDINALITY AS v (share, ordinality) | ||
WHERE | ||
u.ordinality = v.ordinality | ||
AND evt_block_number >= 19613848 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
|
||
sources: | ||
- name: eigenlayer_ethereum | ||
description: "Decoded contracts for EigenLayer on Ethereum" | ||
|
||
tables: | ||
- name: DelegationManager_evt_WithdrawalQueued |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
May be incremental?