Skip to content

Commit

Permalink
Add Sei to nft_transfers (#6832)
Browse files Browse the repository at this point in the history
* Add nft_sei_transfers.sql

* Add Sei to cross-chain spell

* Add Sei table

* Add Sei to schema

* Edited sei schema

* Update _schema.yml

* Update _schema.yml

* Update _schema.yml

* Update dbt_subprojects/nft/models/_sector/transfers/chains/nft_sei_transfers.sql

Co-authored-by: jeff-dude <[email protected]>

* Update nft_sei_transfers.sql

* limit test range

---------

Co-authored-by: jeff-dude <[email protected]>
Co-authored-by: 0xRob <[email protected]>
  • Loading branch information
3 people authored Oct 16, 2024
1 parent 8dce71f commit e24e01d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 7 deletions.
42 changes: 36 additions & 6 deletions dbt_subprojects/nft/models/_sector/transfers/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ version: 2
models:
- name: nft_transfers
meta:
blockchain: ethereum, base, polygon, bnb, avalanche_c, gnosis, optimism, arbitrum, fantom, goerli, celo, zksync, zora, scroll, mantle, blast,
blockchain: ethereum, base, polygon, bnb, avalanche_c, gnosis, optimism, arbitrum, fantom, goerli, celo, zksync, zora, scroll, mantle, blast, sei,
sector: nft
contributors: hildobby, rantum
contributors: hildobby, rantum, petertherock
config:
tags: ['nft', 'ethereum', 'base', 'polygon', 'bnb', 'avalanche_c', 'gnosis', 'optimism', 'arbitrum', 'fantom', 'goerli', 'celo', 'zksync', 'zora', 'scroll', 'mantle', 'blast', 'transfers']
tags: ['nft', 'ethereum', 'base', 'polygon', 'bnb', 'avalanche_c', 'gnosis', 'optimism', 'arbitrum', 'fantom', 'goerli', 'celo', 'zksync', 'zora', 'scroll', 'mantle', 'blast', 'sei', 'transfers']
description: >
NFT transfers
tests:
Expand All @@ -17,6 +17,8 @@ models:
- evt_index
- token_id
- amount
config:
where: "block_time > now() - interval '7' day"
columns:
- &blockchain
name: blockchain
Expand All @@ -31,12 +33,16 @@ models:
tests:
- accepted_values:
values: ['erc721', 'erc1155', 'bep721', 'bep1155']
config:
where: "block_time > now() - interval '7' day"
description: "Token standard"
- &transfer_type
name: transfer_type
tests:
- accepted_values:
values: ['single', 'batch']
config:
where: "block_time > now() - interval '7' day"
description: "single or batch transfer of tokens"
- &evt_index
name: evt_index
Expand Down Expand Up @@ -65,7 +71,9 @@ models:
- &unique_transfer_id
name: unique_transfer_id
tests:
- unique
- unique:
config:
where: "block_time > now() - interval '7' day"
description: "Unique transfer ID"

- name: nft_ethereum_transfers
Expand Down Expand Up @@ -375,7 +383,7 @@ models:
- *token_standard
- *transfer_type
- *unique_transfer_id

- name: nft_linea_transfers
meta:
blockchain: linea
Expand All @@ -397,7 +405,7 @@ models:
- *token_standard
- *transfer_type
- *unique_transfer_id

- name: nft_blast_transfers
meta:
blockchain: blast
Expand Down Expand Up @@ -441,3 +449,25 @@ models:
- *token_standard
- *transfer_type
- *unique_transfer_id

- name: nft_sei_transfers
meta:
blockchain: sei
sector: nft
contributors: petertherock
config:
tags: [ 'nft', 'transfers' ]
description: >
NFT transfers
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
- token_id
- amount
columns:
# only listing columns that have tests here for simplicity
- *token_standard
- *transfer_type
- *unique_transfer_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{
config(
schema="nft_sei",
alias="transfers",
partition_by=["block_month"],
materialized="incremental",
file_format="delta",
incremental_strategy="merge",
incremental_predicates=[
incremental_predicate("DBT_INTERNAL_DEST.block_time")
],
unique_key=["tx_hash", "evt_index", "token_id", "amount"],
)
}}

{{
nft_transfers(
blockchain="sei",
base_transactions=source("sei", "transactions"),
erc721_transfers=source("erc721_sei", "evt_transfer"),
erc1155_single=source("erc1155_sei", "evt_transfersingle"),
erc1155_batch=source("erc1155_sei", "evt_transferbatch"),
)
}}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
post_hook='{{ expose_spells(\'["ethereum", "bnb", "avalanche_c", "gnosis", "optimism", "arbitrum", "polygon", "fantom", "goerli", "base", "celo", "zksync", "zora", "scroll", "linea", "blast", "mantle"]\',
"sector",
"nft",
\'["hildobby", "0xRob", "rantum"]\') }}'
\'["hildobby", "0xRob", "rantum","petertherock"]\') }}'
)
}}

Expand All @@ -33,6 +33,7 @@
,ref('nft_linea_transfers')
,ref('nft_blast_transfers')
,ref('nft_mantle_transfers')
,ref('nft_sei_transfers')
] %}

SELECT *
Expand Down
3 changes: 3 additions & 0 deletions sources/_sector/nft/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ sources:
- name: nft_scroll
tables:
- name: transfers
- name: nft_sei
tables:
- name: transfers

0 comments on commit e24e01d

Please sign in to comment.