update labels (#150)

* update labels

* spelling
This commit is contained in:
eric-laurello 2024-01-30 14:13:37 -05:00 committed by GitHub
parent 8befdb56f5
commit 6f7dce1345
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 29 additions and 21 deletions

View File

@ -0,0 +1,5 @@
{% docs table_dim_labels %}
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/) or on-chain with near (https://near.social/lord1.near/widget/Form) and are reviewed by our labels team. 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.
{% enddocs %}

View File

@ -64,20 +64,9 @@ SELECT
address_name AS label,
project_name,
NULL AS raw_metadata,
COALESCE(
crosschain_labels_id,
{{ dbt_utils.generate_surrogate_key(
[' address ']
) }}
) AS dim_labels_id,
COALESCE(
inserted_timestamp,
'2000-01-01'
) AS inserted_timestamp,
COALESCE(
modified_timestamp,
'2000-01-01'
) AS modified_timestamp
labels_combined_id AS dim_labels_id,
inserted_timestamp,
modified_timestamp
FROM
{{ ref(
'silver__croschain_labels'

View File

@ -1,7 +1,7 @@
version: 2
models:
- name: core__dim_labels
description: Contains token and validator labels for Osmosis.
description: '{{ doc("table_dim_labels") }}'
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:

View File

@ -1,5 +1,10 @@
{{ config(
materialized = 'table',
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); DELETE FROM {{ this }} WHERE _is_deleted = TRUE;",
tags = ['daily']
) }}
@ -13,16 +18,24 @@ SELECT
label_subtype,
address_name,
project_name,
{{ dbt_utils.generate_surrogate_key(
['address']
) }} AS crosschain_labels_id,
_is_deleted,
labels_combined_id,
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp,
'{{ invocation_id }}' AS _invocation_id
FROM
{{ source(
'crosschain',
'dim_labels'
'crosschain_silver',
'labels_combined'
) }}
WHERE
blockchain = 'osmosis'
{% if is_incremental() %}
AND modified_timestamp >= (
SELECT
MAX(modified_timestamp)
FROM
{{ this }}
)
{% endif %}

View File

@ -40,6 +40,7 @@ sources:
- name: hourly_prices_coin_market_cap
- name: hourly_prices_coin_gecko
- name: number_sequence
- name: labels_combined
- name: crosschain
database: "{{ 'crosschain' if target.database == 'OSMOSIS' else 'crosschain_dev' }}"
schema: core