General: Labels: Labels - FlipsideCrypto/fsc-evm GitHub Wiki
This guide covers the Labels Pipeline, deployed to Crosschain, which involves Bronze, Silver and Gold DBT models associated with various third-party APIs, seed files, and Python/R algorithms to collect, aggregate and surface human-readable blockchain data.
<TO_DO>
This guide covers how to build and deploy all tables and views associated with the Labels pipeline, in each respective Blockchain's repository, primarily with references to the Bronze, Silver and Gold fsc_evm labels macros.
Please reference the Labels Pipeline
section above for more information regarding how the pipeline was established, and how each underlying model is intended to function.
- If you find a new source, method or set of labeled EVM addresses, let the Data Science team know so we can add them to the pipeline!
-
Bronze Schema
- The
bronze
model should be materialized as aview
. No other model-level configuration parameters are necessary.
{{ config ( materialized = 'view' ) }}
- To add the following
bronze
schema model (bronze__<table_name>
), please reference fsc_evm label macros.-
bronze__labels.sql
: Address labels associated with a specific blockchain(s). Directly referencescrosschain.silver.labels_combined
.
-
- Define or update the definitions for the following variables in
dbt_project.yml
:## LABELS # LABELS_BLOCKCHAINS: ### OPTIONAL (defaults to target.database (excluding _dev) if not specified)
- The
-
Silver Schema
- The
silver
model should be materialized as anincremental
table, with the following configuration parameters.
{{ config( materialized = 'incremental', unique_key = ['address', 'blockchain'], incremental_strategy = 'merge', merge_exclude_columns = ["inserted_timestamp"], cluster_by = 'modified_timestamp::DATE', post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(address, label_type, label_subtype, address_name, project_name), SUBSTRING(address, label_type, label_subtype, address_name, project_name); DELETE FROM {{ this }} WHERE _is_deleted = TRUE;", tags = ['non_realtime'] ) }}
- To add the following
silver
schema model (silver__<table_name>
), please reference fsc_evm label macros.-
silver__complete_native_asset_metadata.sql
: Directly referencesbronze__labels.sql
and includes incremental logic onmodified_timestamp
.
-
- Add the
.yml
file for the silver model, which includes DBT tests.
- The
-
Gold Schema (
core
)- The Gold
core
model should be materialized as aview
and includes thepersist_docs
param.
{{ config( materialized = 'view', persist_docs ={ "relation": true, "columns": true } ) }}
- To add the following
core
schema model (core__<table_name>
), please reference fsc_evm label macros.-
core__dim_labels.sql
: Directly referencessilver__labels.sql
and updates column names.
-
- Add the
.yml
file for the gold model, which includes table and column level descriptions.
- The Gold