-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create tokens_blast_transfers (#6302)
- Loading branch information
Showing
4 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
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,106 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: tokens_blast_base_transfers | ||
meta: | ||
blockchain: blast | ||
sector: tokens | ||
contributors: aalan3, jeff-dude, hildobby | ||
config: | ||
tags: ['tokens','transfers', 'blast'] | ||
description: > | ||
Token transfers | ||
tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- block_date | ||
- unique_key | ||
columns: | ||
- name: unique_key | ||
description: "Surrogate key to identify unique row" | ||
- name: blockchain | ||
description: "The blockchain of the transfers" | ||
- name: block_date | ||
description: "The date of the block" | ||
- name: block_time | ||
description: "The time of the block" | ||
- name: block_number | ||
description: "The block number" | ||
- name: tx_hash | ||
description: "The transaction hash" | ||
- name: evt_index | ||
description: "The log event index of the transfer if any" | ||
- name: trace_address | ||
description: "The trace address of the transfer if any" | ||
- name: token_standard | ||
description: "The token standard of the transfer" | ||
- name: tx_from | ||
description: "The transaction sender" | ||
- name: tx_to | ||
description: "The transaction receiver" | ||
- name: tx_index | ||
description: "The transaction index" | ||
- name: from | ||
description: "The sender of the transfer" | ||
- name: to | ||
description: "The receiver of the transfer" | ||
- name: contract_address | ||
description: "The contract address of the transfer" | ||
- name: amount_raw | ||
description: "The raw amount of the transfer" | ||
|
||
- name: tokens_blast_transfers | ||
meta: | ||
blockchain: blast | ||
sector: tokens | ||
contributors: aalan3, jeff-dude, hildobby | ||
config: | ||
tags: ['tokens','transfers', 'blast'] | ||
description: > | ||
Token transfers | ||
tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- block_date | ||
- unique_key | ||
columns: | ||
- name: unique_key | ||
description: "Surrogate key to identify unique row" | ||
- name: blockchain | ||
description: "The blockchain of the transfers" | ||
- name: block_date | ||
description: "The date of the block" | ||
- name: block_time | ||
description: "The time of the block" | ||
- name: block_number | ||
description: "The block number" | ||
- name: tx_hash | ||
description: "The transaction hash" | ||
- name: evt_index | ||
description: "The log event index of the transfer if any" | ||
- name: trace_address | ||
description: "The trace address of the transfer if any" | ||
- name: token_standard | ||
description: "The token standard of the transfer" | ||
- name: tx_from | ||
description: "The transaction sender" | ||
- name: tx_to | ||
description: "The transaction receiver" | ||
- name: tx_index | ||
description: "The transaction index" | ||
- name: from | ||
description: "The sender of the transfer" | ||
- name: to | ||
description: "The receiver of the transfer" | ||
- name: contract_address | ||
description: "The contract address of the transfer" | ||
- name: symbol | ||
description: "The token symbol transferred" | ||
- name: amount_raw | ||
description: "The raw amount of the transfer" | ||
- name: amount | ||
description: "The formatted amount of the transfer" | ||
- name: price_usd | ||
description: "The USD price used to calculate the amount_usd" | ||
- name: amount_usd | ||
description: "The USD amount of the transfer" |
20 changes: 20 additions & 0 deletions
20
models/_sector/tokens/blast/tokens_blast_base_transfers.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,20 @@ | ||
{{config( | ||
schema = 'tokens_blast', | ||
alias = 'base_transfers', | ||
partition_by = ['block_date'], | ||
materialized = 'incremental', | ||
file_format = 'delta', | ||
incremental_strategy = 'merge', | ||
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], | ||
unique_key = ['block_date','unique_key'], | ||
) | ||
}} | ||
|
||
{{transfers_base( | ||
blockchain='blast', | ||
traces = source('blast','traces'), | ||
transactions = source('blast','transactions'), | ||
erc20_transfers = source('erc20_blast','evt_transfer'), | ||
native_contract_address = null | ||
) | ||
}} |
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,26 @@ | ||
{{config( | ||
schema = 'tokens_blast', | ||
alias = 'transfers', | ||
partition_by = ['block_date'], | ||
materialized = 'incremental', | ||
file_format = 'delta', | ||
incremental_strategy = 'merge', | ||
unique_key = ['block_date','unique_key'], | ||
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_date')], | ||
post_hook='{{ expose_spells(\'["blast"]\', | ||
"sector", | ||
"tokens", | ||
\'["aalan3", "jeff-dude", "hildobby"]\') }}' | ||
) | ||
}} | ||
|
||
{{ | ||
transfers_enrich( | ||
base_transfers = ref('tokens_blast_base_transfers') | ||
, tokens_erc20_model = source('tokens', 'erc20') | ||
, prices_model = source('prices', 'usd') | ||
, evms_info_model = ref('evms_info') | ||
, transfers_start_date = '2020-04-22' | ||
, blockchain = 'blast' | ||
) | ||
}} |
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 |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
,'zkevm' | ||
,'linea' | ||
,'mantle' | ||
,'blast' | ||
] %} | ||
|
||
SELECT * | ||
|