General: Labels: Labels - FlipsideCrypto/fsc-evm GitHub Wiki

Labels Pipeline

Summary:

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.

Best Practices, Tips & Tricks:

<TO_DO>

Implementation Steps, Variables & Notes:

Examples, References & Sources:


Labels Table Set Up in Chain Specific Repos

Summary:

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.

Best Practices, Tips & Tricks:

  • 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!

Implementation Steps, Variables & Notes:

  1. Bronze Schema

    • The bronze model should be materialized as a view. 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 references crosschain.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)
  2. Silver Schema

    • The silver model should be materialized as an incremental 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 references bronze__labels.sql and includes incremental logic on modified_timestamp.
    • Add the .yml file for the silver model, which includes DBT tests.
  3. Gold Schema (core)

    • The Gold core model should be materialized as a view and includes the persist_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 references silver__labels.sql and updates column names.
    • Add the .yml file for the gold model, which includes table and column level descriptions.

Examples, References & Sources:

⚠️ **GitHub.com Fallback** ⚠️