This commit is contained in:
Eric Laurello 2025-07-28 11:42:02 -04:00
parent 4f8641b9dc
commit 5e776a498c
4 changed files with 105 additions and 1 deletions

View File

@ -0,0 +1,34 @@
{{ config(
materialized = 'incremental',
unique_key = ['address'],
incremental_strategy = 'merge',
merge_exclude_columns = ["inserted_timestamp"],
post_hook = ["ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(address)", "DELETE FROM {{ this }} WHERE address in (select address from {{ ref('silver__crosschain_labels') }} where _is_deleted = TRUE);",],
tags = ['gold','core']
) }}
SELECT
blockchain,
creator,
address,
label_type,
label_subtype,
project_name AS label,
address_name,
labels_combined_id AS dim_labels_id,
inserted_timestamp,
modified_timestamp
FROM
{{ ref('silver__crosschain_labels') }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}

View File

@ -660,3 +660,33 @@ models:
interval: 12
severity: error
tags: ['test_recency']
- name: core__dim_labels
description: "The labels table is a store of one-to-one address identifiers, or an address name. Labels are broken out into a \"type\" (such as cex, dex, dapp, games, etc.) and a \"subtype\" (ex: contract_deployer, hot_wallet, token_contract, etc.) in order to help classify each address name into similar groups. Our labels are sourced from many different places, but can primarily be grouped into two categories: automatic and manual. Automatic labels are continuously labeled based on certain criteria, such as a known contract deploying another contract, behavior based algorithms for finding deposit wallets, and consistent data pulls of custom protocol APIs. Manual labels are done periodically to find addresses that cannot be found programmatically such as finding new protocol addresses, centralized exchange hot wallets, or trending addresses. Labels can also be added by our community by using our add-a-label tool (https://science.flipsidecrypto.xyz/add-a-label/).A label can be removed by our labels team if it is found to be incorrect or no longer relevant; this generally will only happen for mislabeled deposit wallets."
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- ADDRESS
columns:
- name: ADDRESS
description: "Raw address string"
- name: BLOCKCHAIN
description: "In this table, always ton. Used to join to cross-chain tables."
- name: CREATOR
description: "Name of the label creator - for now, this will always be \"Flipside.\""
- name: LABEL_TYPE
description: "A broad category that describes what a label is representing."
- name: LABEL_SUBTYPE
description: "Adds more detail to the label type."
- name: LABEL
description: "The label or name of the address."
- name: ADDRESS_NAME
description: "Name of the labeled address"
- name: DIM_LABELS_ID
description: "Unique primary key for the dimension table, used as the main identifier for each record."
- name: INSERTED_TIMESTAMP
description: "Timestamp when this record was inserted."
- name: MODIFIED_TIMESTAMP
description: "Timestamp when this record was last modified."

View File

@ -0,0 +1,24 @@
{{ config(
materialized = 'view',
tags = ['scheduled_core']
) }}
SELECT
blockchain,
address,
creator,
label_type,
label_subtype,
address_name,
project_name,
_is_deleted,
labels_combined_id,
inserted_timestamp,
modified_timestamp
FROM
{{ source(
'crosschain_silver',
'labels_combined'
) }}
WHERE
blockchain = 'sui'

View File

@ -0,0 +1,16 @@
version: 2
models:
- name: silver__crosschain_labels
columns:
- name: BLOCKCHAIN
- name: ADDRESS
- name: CREATOR
- name: LABEL_TYPE
- name: LABEL_SUBTYPE
- name: ADDRESS_NAME
- name: PROJECT_NAME
- name: _IS_DELETED
- name: LABELS_COMBINED_ID
- name: INSERTED_TIMESTAMP
- name: MODIFIED_TIMESTAMP