mirror of
https://github.com/FlipsideCrypto/external-models.git
synced 2026-02-06 13:37:11 +00:00
tests and docs
This commit is contained in:
parent
bb3c912fde
commit
414c1d1e41
53
.github/workflows/dbt_run_token_terminal_daily.yml
vendored
Normal file
53
.github/workflows/dbt_run_token_terminal_daily.yml
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
name: dbt_run_token_terminal_daily
|
||||
run-name: dbt_run_token_terminal_daily
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Runs "at 15:17 UTC" every day (see https://crontab.guru)
|
||||
- cron: '17 15 * * *'
|
||||
|
||||
env:
|
||||
DBT_PROFILES_DIR: ${{ vars.DBT_PROFILES_DIR }}
|
||||
|
||||
ACCOUNT: "${{ vars.ACCOUNT }}"
|
||||
ROLE: "${{ vars.ROLE }}"
|
||||
USER: "${{ vars.USER }}"
|
||||
PASSWORD: "${{ secrets.PASSWORD }}"
|
||||
REGION: "${{ vars.REGION }}"
|
||||
DATABASE: "${{ vars.DATABASE }}"
|
||||
WAREHOUSE: "${{ vars.WAREHOUSE }}"
|
||||
SCHEMA: "${{ vars.SCHEMA }}"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
|
||||
jobs:
|
||||
run_dbt_jobs:
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: workflow_prod
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.10"
|
||||
cache: "pip"
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
dbt deps
|
||||
|
||||
- name: Run DBT Jobs
|
||||
run: |
|
||||
dbt run -m tag:tt
|
||||
|
||||
notify-failure:
|
||||
needs: [run_dbt_jobs]
|
||||
if: failure()
|
||||
uses: ./.github/workflows/slack_notify.yml
|
||||
secrets:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
53
.github/workflows/dbt_run_token_terminal_streamline_daily.yml
vendored
Normal file
53
.github/workflows/dbt_run_token_terminal_streamline_daily.yml
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
name: dbt_run_token_terminal_streamline_daily
|
||||
run-name: dbt_run_token_terminal_streamline_daily
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Runs "at 13:17 UTC" every day (see https://crontab.guru)
|
||||
- cron: '17 13 * * *'
|
||||
|
||||
env:
|
||||
DBT_PROFILES_DIR: ${{ vars.DBT_PROFILES_DIR }}
|
||||
|
||||
ACCOUNT: "${{ vars.ACCOUNT }}"
|
||||
ROLE: "${{ vars.ROLE }}"
|
||||
USER: "${{ vars.USER }}"
|
||||
PASSWORD: "${{ secrets.PASSWORD }}"
|
||||
REGION: "${{ vars.REGION }}"
|
||||
DATABASE: "${{ vars.DATABASE }}"
|
||||
WAREHOUSE: "${{ vars.WAREHOUSE }}"
|
||||
SCHEMA: "${{ vars.SCHEMA }}"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
|
||||
jobs:
|
||||
run_dbt_jobs:
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: workflow_prod
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.10"
|
||||
cache: "pip"
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
dbt deps
|
||||
|
||||
- name: Run DBT Jobs
|
||||
run: |
|
||||
dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m tag:tt_streamline_realtime
|
||||
|
||||
notify-failure:
|
||||
needs: [run_dbt_jobs]
|
||||
if: failure()
|
||||
uses: ./.github/workflows/slack_notify.yml
|
||||
secrets:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
38
models/token_terminal/gold/token_terminal__dim_datasets.yml
Normal file
38
models/token_terminal/gold/token_terminal__dim_datasets.yml
Normal file
@ -0,0 +1,38 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__dim_datasets
|
||||
description: This table contains dimensional information about datasets available in Token Terminal.
|
||||
|
||||
columns:
|
||||
- name: mart_id
|
||||
description: Unique identifier for the dataset mart.
|
||||
- name: name
|
||||
description: Name of the dataset.
|
||||
- name: dim_datasets_id
|
||||
description: Unique surrogate key generated from mart_id. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
@ -0,0 +1,48 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__dim_market_sector_metadata
|
||||
description: This table contains metadata about market sectors and their associated projects in Token Terminal.
|
||||
|
||||
columns:
|
||||
- name: market_sector_id
|
||||
description: Unique identifier for the market sector.
|
||||
- name: market_sector_name
|
||||
description: Name of the market sector.
|
||||
- name: description_how
|
||||
description: Description of how the market sector operates.
|
||||
- name: description_what
|
||||
description: Description of what the market sector represents.
|
||||
- name: project_id
|
||||
description: Unique identifier for the project associated with this market sector.
|
||||
- name: project_name
|
||||
description: Name of the project.
|
||||
- name: project_url
|
||||
description: URL for the project.
|
||||
- name: dim_market_sector_metadata_id
|
||||
description: Unique surrogate key generated from market_sector_id and project_id. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__dim_market_sectors
|
||||
description: This table contains dimensional information about market sectors in Token Terminal.
|
||||
|
||||
columns:
|
||||
- name: market_sector_id
|
||||
description: Unique identifier for the market sector.
|
||||
- name: market_sector_name
|
||||
description: Name of the market sector.
|
||||
- name: market_sector_url
|
||||
description: URL for the market sector.
|
||||
- name: dim_market_sectors_id
|
||||
description: Unique surrogate key generated from market_sector_id. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
42
models/token_terminal/gold/token_terminal__dim_metrics.yml
Normal file
42
models/token_terminal/gold/token_terminal__dim_metrics.yml
Normal file
@ -0,0 +1,42 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__dim_metrics
|
||||
description: This table contains dimensional information about metrics available in Token Terminal.
|
||||
|
||||
columns:
|
||||
- name: metric_id
|
||||
description: Unique identifier for the metric.
|
||||
- name: metric_name
|
||||
description: Name of the metric.
|
||||
- name: description
|
||||
description: Description of what the metric measures.
|
||||
- name: url
|
||||
description: URL for additional information about the metric.
|
||||
- name: dim_metrics_id
|
||||
description: Unique surrogate key generated from metric_id. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
52
models/token_terminal/gold/token_terminal__dim_projects.yml
Normal file
52
models/token_terminal/gold/token_terminal__dim_projects.yml
Normal file
@ -0,0 +1,52 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__dim_projects
|
||||
description: This table contains dimensional information about projects listed on Token Terminal.
|
||||
|
||||
columns:
|
||||
- name: project_id
|
||||
description: Unique identifier for the project.
|
||||
- name: project_name
|
||||
description: Name of the project.
|
||||
- name: project_symbol
|
||||
description: Symbol for the project token.
|
||||
- name: archived_reason
|
||||
description: Reason why the project was archived, if applicable.
|
||||
- name: coingecko_id
|
||||
description: CoinGecko identifier for the project.
|
||||
- name: is_archived
|
||||
description: Boolean flag indicating if the project is archived.
|
||||
- name: maintenance_reason
|
||||
description: Reason for maintenance status, if applicable.
|
||||
- name: products
|
||||
description: Array of products associated with the project.
|
||||
- name: url
|
||||
description: URL for the project.
|
||||
- name: dim_projects_id
|
||||
description: Unique surrogate key generated from project_id. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
@ -0,0 +1,252 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__ez_blockchain_comparison
|
||||
description: |
|
||||
This table provides comprehensive blockchain comparison metrics from Token Terminal's dataset.
|
||||
It includes ecosystem-level metrics such as active users, developers, TVL, fees, revenue, and transaction counts
|
||||
across different time periods (1d, 7d, 30d, 90d, 180d, 365d) with both absolute values and trend indicators.
|
||||
|
||||
**Key Features:**
|
||||
- Incremental processing for efficient data updates
|
||||
- Cross-chain ecosystem comparison capabilities
|
||||
- Multiple time period aggregations with trend analysis
|
||||
- Market cap metrics for both circulating and fully diluted supply
|
||||
|
||||
**Use Cases:**
|
||||
- Blockchain ecosystem health analysis
|
||||
- Cross-chain performance comparison
|
||||
- Developer activity tracking
|
||||
- DeFi ecosystem growth analysis
|
||||
- Market cap and TVL trend analysis
|
||||
|
||||
columns:
|
||||
- name: chain_id
|
||||
description: Unique identifier for the blockchain chain.
|
||||
tests:
|
||||
- not_null
|
||||
- name: chain_name
|
||||
description: Name of the blockchain.
|
||||
tests:
|
||||
- not_null
|
||||
- name: active_users_daily_latest
|
||||
description: Latest daily active users count.
|
||||
- name: active_users_daily_1d_change
|
||||
description: 1-day change in daily active users.
|
||||
- name: active_users_daily_7d_change
|
||||
description: 7-day change in daily active users.
|
||||
- name: active_users_daily_30d_change
|
||||
description: 30-day change in daily active users.
|
||||
- name: active_users_daily_90d_change
|
||||
description: 90-day change in daily active users.
|
||||
- name: active_users_daily_180d_change
|
||||
description: 180-day change in daily active users.
|
||||
- name: active_users_daily_365d_change
|
||||
description: 365-day change in daily active users.
|
||||
- name: core_developers_latest
|
||||
description: Latest count of core developers.
|
||||
- name: core_developers_1d_change
|
||||
description: 1-day change in core developers.
|
||||
- name: core_developers_7d_change
|
||||
description: 7-day change in core developers.
|
||||
- name: core_developers_30d_change
|
||||
description: 30-day change in core developers.
|
||||
- name: core_developers_90d_change
|
||||
description: 90-day change in core developers.
|
||||
- name: core_developers_180d_change
|
||||
description: 180-day change in core developers.
|
||||
- name: core_developers_365d_change
|
||||
description: 365-day change in core developers.
|
||||
- name: ecosystem_active_loans_latest
|
||||
description: Latest count of active loans in the ecosystem.
|
||||
- name: ecosystem_active_loans_1d_change
|
||||
description: 1-day change in ecosystem active loans.
|
||||
- name: ecosystem_active_loans_7d_change
|
||||
description: 7-day change in ecosystem active loans.
|
||||
- name: ecosystem_active_loans_30d_change
|
||||
description: 30-day change in ecosystem active loans.
|
||||
- name: ecosystem_active_loans_90d_change
|
||||
description: 90-day change in ecosystem active loans.
|
||||
- name: ecosystem_active_loans_180d_change
|
||||
description: 180-day change in ecosystem active loans.
|
||||
- name: ecosystem_active_loans_365d_change
|
||||
description: 365-day change in ecosystem active loans.
|
||||
- name: ecosystem_dex_trading_volume_1d_sum
|
||||
description: 1-day sum of DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_1d_trend
|
||||
description: 1-day trend in DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_7d_sum
|
||||
description: 7-day sum of DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_7d_trend
|
||||
description: 7-day trend in DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_30d_sum
|
||||
description: 30-day sum of DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_30d_trend
|
||||
description: 30-day trend in DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_90d_sum
|
||||
description: 90-day sum of DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_90d_trend
|
||||
description: 90-day trend in DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_180d_sum
|
||||
description: 180-day sum of DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_180d_trend
|
||||
description: 180-day trend in DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_365d_sum
|
||||
description: 365-day sum of DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_365d_trend
|
||||
description: 365-day trend in DEX trading volume.
|
||||
- name: ecosystem_dex_trading_volume_max_sum
|
||||
description: Maximum DEX trading volume sum.
|
||||
- name: ecosystem_fees_1d_sum
|
||||
description: 1-day sum of ecosystem fees.
|
||||
- name: ecosystem_fees_1d_trend
|
||||
description: 1-day trend in ecosystem fees.
|
||||
- name: ecosystem_fees_7d_sum
|
||||
description: 7-day sum of ecosystem fees.
|
||||
- name: ecosystem_fees_7d_trend
|
||||
description: 7-day trend in ecosystem fees.
|
||||
- name: ecosystem_fees_30d_sum
|
||||
description: 30-day sum of ecosystem fees.
|
||||
- name: ecosystem_fees_30d_trend
|
||||
description: 30-day trend in ecosystem fees.
|
||||
- name: ecosystem_fees_90d_sum
|
||||
description: 90-day sum of ecosystem fees.
|
||||
- name: ecosystem_fees_90d_trend
|
||||
description: 90-day trend in ecosystem fees.
|
||||
- name: ecosystem_fees_180d_sum
|
||||
description: 180-day sum of ecosystem fees.
|
||||
- name: ecosystem_fees_180d_trend
|
||||
description: 180-day trend in ecosystem fees.
|
||||
- name: ecosystem_fees_365d_sum
|
||||
description: 365-day sum of ecosystem fees.
|
||||
- name: ecosystem_fees_365d_trend
|
||||
description: 365-day trend in ecosystem fees.
|
||||
- name: ecosystem_fees_max_sum
|
||||
description: Maximum ecosystem fees sum.
|
||||
- name: ecosystem_project_count_latest
|
||||
description: Latest count of projects in the ecosystem.
|
||||
- name: ecosystem_revenue_1d_sum
|
||||
description: 1-day sum of ecosystem revenue.
|
||||
- name: ecosystem_revenue_1d_trend
|
||||
description: 1-day trend in ecosystem revenue.
|
||||
- name: ecosystem_revenue_7d_sum
|
||||
description: 7-day sum of ecosystem revenue.
|
||||
- name: ecosystem_revenue_7d_trend
|
||||
description: 7-day trend in ecosystem revenue.
|
||||
- name: ecosystem_revenue_30d_sum
|
||||
description: 30-day sum of ecosystem revenue.
|
||||
- name: ecosystem_revenue_30d_trend
|
||||
description: 30-day trend in ecosystem revenue.
|
||||
- name: ecosystem_revenue_90d_sum
|
||||
description: 90-day sum of ecosystem revenue.
|
||||
- name: ecosystem_revenue_90d_trend
|
||||
description: 90-day trend in ecosystem revenue.
|
||||
- name: ecosystem_revenue_180d_sum
|
||||
description: 180-day sum of ecosystem revenue.
|
||||
- name: ecosystem_revenue_180d_trend
|
||||
description: 180-day trend in ecosystem revenue.
|
||||
- name: ecosystem_revenue_365d_sum
|
||||
description: 365-day sum of ecosystem revenue.
|
||||
- name: ecosystem_revenue_365d_trend
|
||||
description: 365-day trend in ecosystem revenue.
|
||||
- name: ecosystem_revenue_max_sum
|
||||
description: Maximum ecosystem revenue sum.
|
||||
- name: ecosystem_tvl_latest
|
||||
description: Latest total value locked in the ecosystem.
|
||||
- name: ecosystem_tvl_1d_change
|
||||
description: 1-day change in ecosystem TVL.
|
||||
- name: ecosystem_tvl_7d_change
|
||||
description: 7-day change in ecosystem TVL.
|
||||
- name: ecosystem_tvl_30d_change
|
||||
description: 30-day change in ecosystem TVL.
|
||||
- name: ecosystem_tvl_90d_change
|
||||
description: 90-day change in ecosystem TVL.
|
||||
- name: ecosystem_tvl_180d_change
|
||||
description: 180-day change in ecosystem TVL.
|
||||
- name: ecosystem_tvl_365d_change
|
||||
description: 365-day change in ecosystem TVL.
|
||||
- name: market_cap_circ_latest
|
||||
description: Latest market capitalization based on circulating supply.
|
||||
- name: market_cap_circ_1d_change
|
||||
description: 1-day change in market cap (circulating).
|
||||
- name: market_cap_circ_7d_change
|
||||
description: 7-day change in market cap (circulating).
|
||||
- name: market_cap_circ_30d_change
|
||||
description: 30-day change in market cap (circulating).
|
||||
- name: market_cap_circ_90d_change
|
||||
description: 90-day change in market cap (circulating).
|
||||
- name: market_cap_circ_180d_change
|
||||
description: 180-day change in market cap (circulating).
|
||||
- name: market_cap_circ_365d_change
|
||||
description: 365-day change in market cap (circulating).
|
||||
- name: market_cap_fd_latest
|
||||
description: Latest market capitalization based on fully diluted supply.
|
||||
- name: market_cap_fd_1d_change
|
||||
description: 1-day change in market cap (fully diluted).
|
||||
- name: market_cap_fd_7d_change
|
||||
description: 7-day change in market cap (fully diluted).
|
||||
- name: market_cap_fd_30d_change
|
||||
description: 30-day change in market cap (fully diluted).
|
||||
- name: market_cap_fd_90d_change
|
||||
description: 90-day change in market cap (fully diluted).
|
||||
- name: market_cap_fd_180d_change
|
||||
description: 180-day change in market cap (fully diluted).
|
||||
- name: market_cap_fd_365d_change
|
||||
description: 365-day change in market cap (fully diluted).
|
||||
- name: transaction_count_1d
|
||||
description: 1-day transaction count.
|
||||
- name: transaction_count_1d_trend
|
||||
description: 1-day trend in transaction count.
|
||||
- name: transaction_count_7d
|
||||
description: 7-day transaction count.
|
||||
- name: transaction_count_7d_trend
|
||||
description: 7-day trend in transaction count.
|
||||
- name: transaction_count_30d
|
||||
description: 30-day transaction count.
|
||||
- name: transaction_count_30d_trend
|
||||
description: 30-day trend in transaction count.
|
||||
- name: transaction_count_90d
|
||||
description: 90-day transaction count.
|
||||
- name: transaction_count_90d_trend
|
||||
description: 90-day trend in transaction count.
|
||||
- name: transaction_count_180d
|
||||
description: 180-day transaction count.
|
||||
- name: transaction_count_180d_trend
|
||||
description: 180-day trend in transaction count.
|
||||
- name: transaction_count_365d
|
||||
description: 365-day transaction count.
|
||||
- name: transaction_count_365d_trend
|
||||
description: 365-day trend in transaction count.
|
||||
- name: transaction_count_max
|
||||
description: Maximum transaction count.
|
||||
- name: blockchain_comparison_data
|
||||
description: Raw JSON data containing all blockchain comparison metrics.
|
||||
- name: run_date
|
||||
description: Date when the data was run/collected.
|
||||
- name: ez_blockchain_comparison_id
|
||||
description: Unique surrogate key generated from chain_id. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
@ -0,0 +1,89 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__ez_cohort_analysis
|
||||
description: |
|
||||
This table provides cohort analysis data from Token Terminal, tracking user retention and activity
|
||||
across different cohorts over time. Each cohort represents users who first engaged with a project
|
||||
in a specific time period, and the table tracks their activity over subsequent months.
|
||||
|
||||
**Key Features:**
|
||||
- Incremental processing for efficient data updates
|
||||
- Project-level cohort tracking
|
||||
- Monthly retention metrics (month_0 through month_11)
|
||||
- Market sector classification
|
||||
|
||||
**Use Cases:**
|
||||
- User retention analysis
|
||||
- Cohort-based performance evaluation
|
||||
- Project engagement trend analysis
|
||||
- Market sector comparison of user retention
|
||||
|
||||
columns:
|
||||
- name: cohort_timestamp
|
||||
description: Timestamp representing when the cohort was formed (when users first engaged).
|
||||
tests:
|
||||
- not_null
|
||||
- name: project_id
|
||||
description: Unique identifier for the project.
|
||||
tests:
|
||||
- not_null
|
||||
- name: project_name
|
||||
description: Name of the project.
|
||||
- name: initial_cohort_size
|
||||
description: Initial size of the cohort when it was formed.
|
||||
- name: market_sector_id
|
||||
description: Unique identifier for the market sector.
|
||||
- name: market_sector_name
|
||||
description: Name of the market sector.
|
||||
- name: month_0
|
||||
description: Retention metric for month 0 (cohort formation month).
|
||||
- name: month_1
|
||||
description: Retention metric for month 1 after cohort formation.
|
||||
- name: month_2
|
||||
description: Retention metric for month 2 after cohort formation.
|
||||
- name: month_3
|
||||
description: Retention metric for month 3 after cohort formation.
|
||||
- name: month_4
|
||||
description: Retention metric for month 4 after cohort formation.
|
||||
- name: month_5
|
||||
description: Retention metric for month 5 after cohort formation.
|
||||
- name: month_6
|
||||
description: Retention metric for month 6 after cohort formation.
|
||||
- name: month_7
|
||||
description: Retention metric for month 7 after cohort formation.
|
||||
- name: month_8
|
||||
description: Retention metric for month 8 after cohort formation.
|
||||
- name: month_9
|
||||
description: Retention metric for month 9 after cohort formation.
|
||||
- name: month_10
|
||||
description: Retention metric for month 10 after cohort formation.
|
||||
- name: month_11
|
||||
description: Retention metric for month 11 after cohort formation.
|
||||
- name: ez_cohort_analysis_id
|
||||
description: Unique surrogate key generated from cohort_timestamp and project_id. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__ez_crypto_screener
|
||||
description: |
|
||||
This table provides comprehensive crypto screener data from Token Terminal, containing a wide variety
|
||||
of metrics and attributes for projects that can be used for screening and filtering. The table includes
|
||||
both structured columns and a raw JSON field containing all screener data.
|
||||
|
||||
**Key Features:**
|
||||
- Incremental processing for efficient data updates
|
||||
- Project-level screening metrics
|
||||
- Comprehensive metric coverage in JSON format
|
||||
|
||||
**Use Cases:**
|
||||
- Project screening and filtering
|
||||
- Comparative analysis across projects
|
||||
- Investment research and due diligence
|
||||
- Market trend identification
|
||||
|
||||
columns:
|
||||
- name: project_id
|
||||
description: Unique identifier for the project.
|
||||
tests:
|
||||
- not_null
|
||||
- name: project_name
|
||||
description: Name of the project.
|
||||
- name: screener_data
|
||||
description: Raw JSON data containing all crypto screener metrics and attributes for the project.
|
||||
- name: ez_crypto_screener_id
|
||||
description: Unique surrogate key generated from project_id. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
@ -0,0 +1,111 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__ez_insider_transactions
|
||||
description: |
|
||||
This table provides insider transaction data from Token Terminal, tracking transactions made by
|
||||
insider accounts (such as team members, investors, or other privileged accounts) for various projects.
|
||||
The table includes transaction details, token information, and insider account metadata.
|
||||
|
||||
**Key Features:**
|
||||
- Incremental processing for efficient data updates
|
||||
- Cross-chain transaction tracking
|
||||
- Insider account classification
|
||||
- Position tracking and percentage calculations
|
||||
|
||||
**Use Cases:**
|
||||
- Insider trading analysis
|
||||
- Token distribution monitoring
|
||||
- Project team activity tracking
|
||||
- Regulatory compliance monitoring
|
||||
|
||||
columns:
|
||||
- name: chain_id
|
||||
description: Unique identifier for the blockchain chain.
|
||||
tests:
|
||||
- not_null
|
||||
- name: chain_name
|
||||
description: Name of the blockchain.
|
||||
tests:
|
||||
- not_null
|
||||
- name: project_id
|
||||
description: Unique identifier for the project.
|
||||
tests:
|
||||
- not_null
|
||||
- name: project_name
|
||||
description: Name of the project.
|
||||
- name: timestamp
|
||||
description: Timestamp of the transaction.
|
||||
tests:
|
||||
- not_null
|
||||
- name: transaction_hash
|
||||
description: Hash of the transaction.
|
||||
tests:
|
||||
- not_null
|
||||
- name: transaction_number
|
||||
description: Transaction number or sequence.
|
||||
tests:
|
||||
- not_null
|
||||
- name: transaction_type
|
||||
description: Type of transaction.
|
||||
- name: action_type
|
||||
description: Type of action performed in the transaction.
|
||||
- name: token_address
|
||||
description: Address of the token involved in the transaction.
|
||||
tests:
|
||||
- not_null
|
||||
- name: token_symbol
|
||||
description: Symbol of the token.
|
||||
- name: token_standard
|
||||
description: Token standard (e.g., ERC-20, ERC-721).
|
||||
- name: amount_native
|
||||
description: Amount in native token units.
|
||||
- name: amount_usd
|
||||
description: Amount in USD.
|
||||
- name: flow_usd
|
||||
description: Flow amount in USD.
|
||||
- name: insider_account_address
|
||||
description: Address of the insider account.
|
||||
tests:
|
||||
- not_null
|
||||
- name: insider_account_title
|
||||
description: Title or role of the insider account.
|
||||
- name: insider_type
|
||||
description: Type of insider (e.g., team, investor).
|
||||
- name: market_sector_id
|
||||
description: Unique identifier for the market sector.
|
||||
- name: market_sector_name
|
||||
description: Name of the market sector.
|
||||
- name: percentage_of_position
|
||||
description: Percentage of the position that this transaction represents.
|
||||
- name: position_creation_timestamp
|
||||
description: Timestamp when the position was created.
|
||||
- name: post_transaction_position
|
||||
description: Position size after the transaction.
|
||||
- name: ez_insider_transactions_id
|
||||
description: Unique surrogate key generated from chain_id, project_id, transaction_hash, transaction_number, insider_account_address, and token_address. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
278
models/token_terminal/gold/token_terminal__ez_stablecoins.yml
Normal file
278
models/token_terminal/gold/token_terminal__ez_stablecoins.yml
Normal file
@ -0,0 +1,278 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__ez_stablecoins
|
||||
description: |
|
||||
This table provides comprehensive stablecoin metrics from Token Terminal, including mint/redemption data,
|
||||
transfer metrics, price and peg information, and holder statistics across different time periods.
|
||||
The table enables analysis of stablecoin performance, adoption, and stability metrics.
|
||||
|
||||
**Key Features:**
|
||||
- Incremental processing for efficient data updates
|
||||
- Cross-chain stablecoin tracking
|
||||
- Multiple time period aggregations (1d, 7d, 30d, 90d, 180d, 365d)
|
||||
- Trend analysis for key metrics
|
||||
- Peg deviation tracking
|
||||
|
||||
**Use Cases:**
|
||||
- Stablecoin market analysis
|
||||
- Peg stability monitoring
|
||||
- Cross-chain stablecoin adoption tracking
|
||||
- Mint/redemption pattern analysis
|
||||
- Holder and transfer activity analysis
|
||||
|
||||
columns:
|
||||
- name: account_creation_timestamp
|
||||
description: Timestamp when the account was created.
|
||||
- name: chain_id
|
||||
description: Unique identifier for the blockchain chain.
|
||||
tests:
|
||||
- not_null
|
||||
- name: chain_name
|
||||
description: Name of the blockchain.
|
||||
tests:
|
||||
- not_null
|
||||
- name: market_sector_id
|
||||
description: Unique identifier for the market sector.
|
||||
- name: market_sector_name
|
||||
description: Name of the market sector.
|
||||
- name: project_id
|
||||
description: Unique identifier for the project.
|
||||
- name: project_name
|
||||
description: Name of the project.
|
||||
- name: stablecoin_name
|
||||
description: Name of the stablecoin.
|
||||
- name: stablecoin_peg
|
||||
description: Peg currency for the stablecoin (e.g., USD, EUR).
|
||||
- name: stablecoin_ticker
|
||||
description: Ticker symbol for the stablecoin.
|
||||
- name: token_address
|
||||
description: Address of the stablecoin token.
|
||||
tests:
|
||||
- not_null
|
||||
- name: outstanding_supply_latest
|
||||
description: Latest outstanding supply of the stablecoin.
|
||||
- name: outstanding_supply_1d_change
|
||||
description: 1-day change in outstanding supply.
|
||||
- name: outstanding_supply_7d_change
|
||||
description: 7-day change in outstanding supply.
|
||||
- name: outstanding_supply_30d_change
|
||||
description: 30-day change in outstanding supply.
|
||||
- name: outstanding_supply_90d_change
|
||||
description: 90-day change in outstanding supply.
|
||||
- name: outstanding_supply_180d_change
|
||||
description: 180-day change in outstanding supply.
|
||||
- name: outstanding_supply_365d_change
|
||||
description: 365-day change in outstanding supply.
|
||||
- name: price_latest
|
||||
description: Latest price of the stablecoin.
|
||||
- name: price_1d_change
|
||||
description: 1-day price change.
|
||||
- name: price_7d_change
|
||||
description: 7-day price change.
|
||||
- name: price_30d_change
|
||||
description: 30-day price change.
|
||||
- name: price_90d_change
|
||||
description: 90-day price change.
|
||||
- name: price_180d_change
|
||||
description: 180-day price change.
|
||||
- name: price_365d_change
|
||||
description: 365-day price change.
|
||||
- name: percent_off_peg_latest
|
||||
description: Latest percentage deviation from peg.
|
||||
- name: percent_off_peg_1d
|
||||
description: 1-day percentage deviation from peg.
|
||||
- name: percent_off_peg_7d
|
||||
description: 7-day percentage deviation from peg.
|
||||
- name: percent_off_peg_30d
|
||||
description: 30-day percentage deviation from peg.
|
||||
- name: percent_off_peg_90d
|
||||
description: 90-day percentage deviation from peg.
|
||||
- name: percent_off_peg_180d
|
||||
description: 180-day percentage deviation from peg.
|
||||
- name: percent_off_peg_365d
|
||||
description: 365-day percentage deviation from peg.
|
||||
- name: percent_off_peg_max
|
||||
description: Maximum percentage deviation from peg.
|
||||
- name: tokenholders_latest
|
||||
description: Latest count of token holders.
|
||||
- name: tokenholders_1d_change
|
||||
description: 1-day change in token holders.
|
||||
- name: tokenholders_7d_change
|
||||
description: 7-day change in token holders.
|
||||
- name: tokenholders_30d_change
|
||||
description: 30-day change in token holders.
|
||||
- name: tokenholders_90d_change
|
||||
description: 90-day change in token holders.
|
||||
- name: tokenholders_180d_change
|
||||
description: 180-day change in token holders.
|
||||
- name: tokenholders_365d_change
|
||||
description: 365-day change in token holders.
|
||||
- name: mints_1d_sum
|
||||
description: 1-day sum of mints.
|
||||
- name: mints_1d_trend
|
||||
description: 1-day trend in mints.
|
||||
- name: mints_7d_sum
|
||||
description: 7-day sum of mints.
|
||||
- name: mints_7d_trend
|
||||
description: 7-day trend in mints.
|
||||
- name: mints_30d_sum
|
||||
description: 30-day sum of mints.
|
||||
- name: mints_30d_trend
|
||||
description: 30-day trend in mints.
|
||||
- name: mints_90d_sum
|
||||
description: 90-day sum of mints.
|
||||
- name: mints_90d_trend
|
||||
description: 90-day trend in mints.
|
||||
- name: mints_180d_sum
|
||||
description: 180-day sum of mints.
|
||||
- name: mints_180d_trend
|
||||
description: 180-day trend in mints.
|
||||
- name: mints_365d_sum
|
||||
description: 365-day sum of mints.
|
||||
- name: mints_365d_trend
|
||||
description: 365-day trend in mints.
|
||||
- name: mints_max_sum
|
||||
description: Maximum sum of mints.
|
||||
- name: redemptions_1d_sum
|
||||
description: 1-day sum of redemptions.
|
||||
- name: redemptions_1d_trend
|
||||
description: 1-day trend in redemptions.
|
||||
- name: redemptions_7d_sum
|
||||
description: 7-day sum of redemptions.
|
||||
- name: redemptions_7d_trend
|
||||
description: 7-day trend in redemptions.
|
||||
- name: redemptions_30d_sum
|
||||
description: 30-day sum of redemptions.
|
||||
- name: redemptions_30d_trend
|
||||
description: 30-day trend in redemptions.
|
||||
- name: redemptions_90d_sum
|
||||
description: 90-day sum of redemptions.
|
||||
- name: redemptions_90d_trend
|
||||
description: 90-day trend in redemptions.
|
||||
- name: redemptions_180d_sum
|
||||
description: 180-day sum of redemptions.
|
||||
- name: redemptions_180d_trend
|
||||
description: 180-day trend in redemptions.
|
||||
- name: redemptions_365d_sum
|
||||
description: 365-day sum of redemptions.
|
||||
- name: redemptions_365d_trend
|
||||
description: 365-day trend in redemptions.
|
||||
- name: redemptions_max_sum
|
||||
description: Maximum sum of redemptions.
|
||||
- name: transfer_count_1d_sum
|
||||
description: 1-day sum of transfer count.
|
||||
- name: transfer_count_1d_trend
|
||||
description: 1-day trend in transfer count.
|
||||
- name: transfer_count_7d_sum
|
||||
description: 7-day sum of transfer count.
|
||||
- name: transfer_count_7d_trend
|
||||
description: 7-day trend in transfer count.
|
||||
- name: transfer_count_30d_sum
|
||||
description: 30-day sum of transfer count.
|
||||
- name: transfer_count_30d_trend
|
||||
description: 30-day trend in transfer count.
|
||||
- name: transfer_count_90d_sum
|
||||
description: 90-day sum of transfer count.
|
||||
- name: transfer_count_90d_trend
|
||||
description: 90-day trend in transfer count.
|
||||
- name: transfer_count_180d_sum
|
||||
description: 180-day sum of transfer count.
|
||||
- name: transfer_count_180d_trend
|
||||
description: 180-day trend in transfer count.
|
||||
- name: transfer_count_365d_sum
|
||||
description: 365-day sum of transfer count.
|
||||
- name: transfer_count_365d_trend
|
||||
description: 365-day trend in transfer count.
|
||||
- name: transfer_count_max_sum
|
||||
description: Maximum sum of transfer count.
|
||||
- name: transfer_volume_1d_sum
|
||||
description: 1-day sum of transfer volume.
|
||||
- name: transfer_volume_1d_trend
|
||||
description: 1-day trend in transfer volume.
|
||||
- name: transfer_volume_7d_sum
|
||||
description: 7-day sum of transfer volume.
|
||||
- name: transfer_volume_7d_trend
|
||||
description: 7-day trend in transfer volume.
|
||||
- name: transfer_volume_30d_sum
|
||||
description: 30-day sum of transfer volume.
|
||||
- name: transfer_volume_30d_trend
|
||||
description: 30-day trend in transfer volume.
|
||||
- name: transfer_volume_90d_sum
|
||||
description: 90-day sum of transfer volume.
|
||||
- name: transfer_volume_90d_trend
|
||||
description: 90-day trend in transfer volume.
|
||||
- name: transfer_volume_180d_sum
|
||||
description: 180-day sum of transfer volume.
|
||||
- name: transfer_volume_180d_trend
|
||||
description: 180-day trend in transfer volume.
|
||||
- name: transfer_volume_365d_sum
|
||||
description: 365-day sum of transfer volume.
|
||||
- name: transfer_volume_365d_trend
|
||||
description: 365-day trend in transfer volume.
|
||||
- name: transfer_volume_max_sum
|
||||
description: Maximum sum of transfer volume.
|
||||
- name: stablecoin_senders_1d_sum
|
||||
description: 1-day sum of stablecoin senders.
|
||||
- name: stablecoin_senders_1d_trend
|
||||
description: 1-day trend in stablecoin senders.
|
||||
- name: stablecoin_senders_7d_sum
|
||||
description: 7-day sum of stablecoin senders.
|
||||
- name: stablecoin_senders_7d_trend
|
||||
description: 7-day trend in stablecoin senders.
|
||||
- name: stablecoin_senders_30d_sum
|
||||
description: 30-day sum of stablecoin senders.
|
||||
- name: stablecoin_senders_30d_trend
|
||||
description: 30-day trend in stablecoin senders.
|
||||
- name: stablecoin_senders_90d_sum
|
||||
description: 90-day sum of stablecoin senders.
|
||||
- name: stablecoin_senders_90d_trend
|
||||
description: 90-day trend in stablecoin senders.
|
||||
- name: stablecoin_senders_180d_sum
|
||||
description: 180-day sum of stablecoin senders.
|
||||
- name: stablecoin_senders_180d_trend
|
||||
description: 180-day trend in stablecoin senders.
|
||||
- name: stablecoin_senders_365d_sum
|
||||
description: 365-day sum of stablecoin senders.
|
||||
- name: stablecoin_senders_365d_trend
|
||||
description: 365-day trend in stablecoin senders.
|
||||
- name: transfer_value_average_latest
|
||||
description: Latest average transfer value.
|
||||
- name: transfer_value_average_1d_change
|
||||
description: 1-day change in average transfer value.
|
||||
- name: transfer_value_average_7d_change
|
||||
description: 7-day change in average transfer value.
|
||||
- name: transfer_value_average_30d_change
|
||||
description: 30-day change in average transfer value.
|
||||
- name: transfer_value_average_90d_change
|
||||
description: 90-day change in average transfer value.
|
||||
- name: transfer_value_average_180d_change
|
||||
description: 180-day change in average transfer value.
|
||||
- name: transfer_value_average_365d_change
|
||||
description: 365-day change in average transfer value.
|
||||
- name: ez_stablecoins_id
|
||||
description: Unique surrogate key generated from chain_id and token_address. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
@ -63,7 +63,7 @@ SELECT
|
||||
['project_id','metric_timestamp']
|
||||
) }} AS fact_project_metrics_id
|
||||
FROM {{ ref('silver__tt_project_metrics') }}
|
||||
WHERE 1=1
|
||||
WHERE project_id is not null
|
||||
{% if is_incremental() %}
|
||||
AND modified_timestamp > (
|
||||
SELECT coalesce(MAX(modified_timestamp), '2000-01-01') FROM {{ this }}
|
||||
|
||||
@ -0,0 +1,138 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__fact_project_metrics
|
||||
description: This table contains time-series metrics for projects in Token Terminal, including financial metrics, user metrics, and token metrics.
|
||||
|
||||
columns:
|
||||
- name: metric_timestamp
|
||||
description: Timestamp for when the metrics were recorded.
|
||||
tests:
|
||||
- not_null
|
||||
- name: project_id
|
||||
description: Unique identifier for the project.
|
||||
tests:
|
||||
- not_null
|
||||
- name: project_name
|
||||
description: Name of the project.
|
||||
- name: active_addresses_daily
|
||||
description: Number of active addresses on a daily basis.
|
||||
- name: active_addresses_monthly
|
||||
description: Number of active addresses on a monthly basis.
|
||||
- name: active_addresses_weekly
|
||||
description: Number of active addresses on a weekly basis.
|
||||
- name: active_developers
|
||||
description: Number of active developers.
|
||||
- name: active_loans
|
||||
description: Number of active loans.
|
||||
- name: afpu
|
||||
description: Average fees per user.
|
||||
- name: arpu
|
||||
description: Average revenue per user.
|
||||
- name: asset_market_cap_circulating
|
||||
description: Market cap of assets in circulation.
|
||||
- name: code_commits
|
||||
description: Number of code commits.
|
||||
- name: earnings
|
||||
description: Earnings amount.
|
||||
- name: expenses
|
||||
description: Expenses amount.
|
||||
- name: fees
|
||||
description: Total fees collected.
|
||||
- name: fees_supply_side
|
||||
description: Fees allocated to the supply side.
|
||||
- name: gas_used
|
||||
description: Amount of gas used.
|
||||
- name: market_cap_circulating
|
||||
description: Market capitalization based on circulating supply.
|
||||
- name: market_cap_fully_diluted
|
||||
description: Market capitalization based on fully diluted supply.
|
||||
- name: net_deposits
|
||||
description: Net deposits amount.
|
||||
- name: outstanding_supply
|
||||
description: Outstanding supply of tokens.
|
||||
- name: pf_circulating
|
||||
description: Price-to-fees ratio based on circulating supply.
|
||||
- name: pf_fully_diluted
|
||||
description: Price-to-fees ratio based on fully diluted supply.
|
||||
- name: price
|
||||
description: Token price.
|
||||
- name: ps_circulating
|
||||
description: Price-to-sales ratio based on circulating supply.
|
||||
- name: ps_fully_diluted
|
||||
description: Price-to-sales ratio based on fully diluted supply.
|
||||
- name: revenue
|
||||
description: Revenue amount.
|
||||
- name: stablecoin_dau
|
||||
description: Daily active users for stablecoin operations.
|
||||
- name: stablecoin_holders
|
||||
description: Number of stablecoin holders.
|
||||
- name: stablecoin_mau
|
||||
description: Monthly active users for stablecoin operations.
|
||||
- name: stablecoin_mints
|
||||
description: Number of stablecoin mints.
|
||||
- name: stablecoin_redemptions
|
||||
description: Number of stablecoin redemptions.
|
||||
- name: stablecoin_transfer_count
|
||||
description: Count of stablecoin transfers.
|
||||
- name: stablecoin_transfer_volume
|
||||
description: Volume of stablecoin transfers.
|
||||
- name: stablecoin_wau
|
||||
description: Weekly active users for stablecoin operations.
|
||||
- name: token_incentives
|
||||
description: Amount of token incentives.
|
||||
- name: token_supply_circulating
|
||||
description: Circulating token supply.
|
||||
- name: token_supply_maximum
|
||||
description: Maximum token supply.
|
||||
- name: token_trading_volume
|
||||
description: Token trading volume.
|
||||
- name: token_turnover_circulating
|
||||
description: Token turnover based on circulating supply.
|
||||
- name: token_turnover_fully_diluted
|
||||
description: Token turnover based on fully diluted supply.
|
||||
- name: tokenholders
|
||||
description: Number of token holders.
|
||||
- name: transaction_count_contracts
|
||||
description: Count of contract transactions.
|
||||
- name: treasury
|
||||
description: Treasury amount.
|
||||
- name: treasury_net
|
||||
description: Net treasury amount.
|
||||
- name: tvl
|
||||
description: Total value locked.
|
||||
- name: user_dau
|
||||
description: Daily active users.
|
||||
- name: user_mau
|
||||
description: Monthly active users.
|
||||
- name: user_wau
|
||||
description: Weekly active users.
|
||||
- name: project_metrics_data
|
||||
description: Raw JSON data containing all project metrics.
|
||||
- name: fact_project_metrics_id
|
||||
description: Unique surrogate key generated from project_id and metric_timestamp. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
@ -0,0 +1,144 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: token_terminal__fact_project_product_metrics
|
||||
description: This table contains time-series metrics for project products in Token Terminal, including financial metrics, user metrics, and token metrics at the product level.
|
||||
|
||||
columns:
|
||||
- name: metric_timestamp
|
||||
description: Timestamp for when the metrics were recorded.
|
||||
tests:
|
||||
- not_null
|
||||
- name: project_id
|
||||
description: Unique identifier for the project.
|
||||
tests:
|
||||
- not_null
|
||||
- name: product_id
|
||||
description: Unique identifier for the product.
|
||||
tests:
|
||||
- not_null
|
||||
- name: project_name
|
||||
description: Name of the project.
|
||||
- name: product_name
|
||||
description: Name of the product.
|
||||
- name: active_addresses_daily
|
||||
description: Number of active addresses on a daily basis.
|
||||
- name: active_addresses_monthly
|
||||
description: Number of active addresses on a monthly basis.
|
||||
- name: active_addresses_weekly
|
||||
description: Number of active addresses on a weekly basis.
|
||||
- name: active_developers
|
||||
description: Number of active developers.
|
||||
- name: active_loans
|
||||
description: Number of active loans.
|
||||
- name: afpu
|
||||
description: Average fees per user.
|
||||
- name: arpu
|
||||
description: Average revenue per user.
|
||||
- name: asset_market_cap_circulating
|
||||
description: Market cap of assets in circulation.
|
||||
- name: code_commits
|
||||
description: Number of code commits.
|
||||
- name: earnings
|
||||
description: Earnings amount.
|
||||
- name: expenses
|
||||
description: Expenses amount.
|
||||
- name: fees
|
||||
description: Total fees collected.
|
||||
- name: fees_supply_side
|
||||
description: Fees allocated to the supply side.
|
||||
- name: gas_used
|
||||
description: Amount of gas used.
|
||||
- name: market_cap_circulating
|
||||
description: Market capitalization based on circulating supply.
|
||||
- name: market_cap_fully_diluted
|
||||
description: Market capitalization based on fully diluted supply.
|
||||
- name: net_deposits
|
||||
description: Net deposits amount.
|
||||
- name: outstanding_supply
|
||||
description: Outstanding supply of tokens.
|
||||
- name: pf_circulating
|
||||
description: Price-to-fees ratio based on circulating supply.
|
||||
- name: pf_fully_diluted
|
||||
description: Price-to-fees ratio based on fully diluted supply.
|
||||
- name: price
|
||||
description: Token price.
|
||||
- name: ps_circulating
|
||||
description: Price-to-sales ratio based on circulating supply.
|
||||
- name: ps_fully_diluted
|
||||
description: Price-to-sales ratio based on fully diluted supply.
|
||||
- name: revenue
|
||||
description: Revenue amount.
|
||||
- name: stablecoin_dau
|
||||
description: Daily active users for stablecoin operations.
|
||||
- name: stablecoin_holders
|
||||
description: Number of stablecoin holders.
|
||||
- name: stablecoin_mau
|
||||
description: Monthly active users for stablecoin operations.
|
||||
- name: stablecoin_mints
|
||||
description: Number of stablecoin mints.
|
||||
- name: stablecoin_redemptions
|
||||
description: Number of stablecoin redemptions.
|
||||
- name: stablecoin_transfer_count
|
||||
description: Count of stablecoin transfers.
|
||||
- name: stablecoin_transfer_volume
|
||||
description: Volume of stablecoin transfers.
|
||||
- name: stablecoin_wau
|
||||
description: Weekly active users for stablecoin operations.
|
||||
- name: token_incentives
|
||||
description: Amount of token incentives.
|
||||
- name: token_supply_circulating
|
||||
description: Circulating token supply.
|
||||
- name: token_supply_maximum
|
||||
description: Maximum token supply.
|
||||
- name: token_trading_volume
|
||||
description: Token trading volume.
|
||||
- name: token_turnover_circulating
|
||||
description: Token turnover based on circulating supply.
|
||||
- name: token_turnover_fully_diluted
|
||||
description: Token turnover based on fully diluted supply.
|
||||
- name: tokenholders
|
||||
description: Number of token holders.
|
||||
- name: transaction_count_contracts
|
||||
description: Count of contract transactions.
|
||||
- name: treasury
|
||||
description: Treasury amount.
|
||||
- name: treasury_net
|
||||
description: Net treasury amount.
|
||||
- name: tvl
|
||||
description: Total value locked.
|
||||
- name: user_dau
|
||||
description: Daily active users.
|
||||
- name: user_mau
|
||||
description: Monthly active users.
|
||||
- name: user_wau
|
||||
description: Weekly active users.
|
||||
- name: project_metrics_data
|
||||
description: Raw JSON data containing all project product metrics.
|
||||
- name: fact_project_product_metrics_id
|
||||
description: Unique surrogate key generated from project_id, product_id, and metric_timestamp. This serves as the primary key for the table.
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
- name: inserted_timestamp
|
||||
description: Timestamp when the record was inserted into this table.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: modified_timestamp
|
||||
description: Timestamp when the record was last modified.
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: _invocation_id
|
||||
description: The dbt invocation ID for the run that created this record.
|
||||
|
||||
22
models/token_terminal/silver/silver__tt_dataset_values.yml
Normal file
22
models/token_terminal/silver/silver__tt_dataset_values.yml
Normal file
@ -0,0 +1,22 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: silver__tt_dataset_values
|
||||
tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- tt_dataset_values_id
|
||||
|
||||
columns:
|
||||
- name: inserted_timestamp
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: tt_dataset_values_id
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
22
models/token_terminal/silver/silver__tt_datasets.yml
Normal file
22
models/token_terminal/silver/silver__tt_datasets.yml
Normal file
@ -0,0 +1,22 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: silver__tt_datasets
|
||||
tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- tt_datasets_id
|
||||
|
||||
columns:
|
||||
- name: inserted_timestamp
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: tt_datasets_id
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: silver__tt_market_sector_metadata
|
||||
tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- tt_market_sector_metadata_id
|
||||
|
||||
columns:
|
||||
- name: inserted_timestamp
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: tt_market_sector_metadata_id
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
22
models/token_terminal/silver/silver__tt_market_sectors.yml
Normal file
22
models/token_terminal/silver/silver__tt_market_sectors.yml
Normal file
@ -0,0 +1,22 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: silver__tt_market_sectors
|
||||
tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- tt_market_sectors_id
|
||||
|
||||
columns:
|
||||
- name: inserted_timestamp
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: tt_market_sectors_id
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
21
models/token_terminal/silver/silver__tt_metrics.yml
Normal file
21
models/token_terminal/silver/silver__tt_metrics.yml
Normal file
@ -0,0 +1,21 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: silver__tt_metrics
|
||||
tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- tt_metrics_id
|
||||
|
||||
columns:
|
||||
- name: inserted_timestamp
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: tt_metrics_id
|
||||
tests:
|
||||
- not_null
|
||||
@ -26,8 +26,10 @@ SELECT
|
||||
where _inserted_timestamp > (
|
||||
select coalesce(max(_inserted_timestamp), '2000-01-01') from {{ this }}
|
||||
)
|
||||
where project_id is not null and metric_id is not null
|
||||
{% else %}
|
||||
{{ ref('bronze__tt_project_metrics_FR') }}
|
||||
where project_id is not null and metric_id is not null
|
||||
{% endif %}
|
||||
|
||||
QUALIFY(
|
||||
|
||||
22
models/token_terminal/silver/silver__tt_project_metrics.yml
Normal file
22
models/token_terminal/silver/silver__tt_project_metrics.yml
Normal file
@ -0,0 +1,22 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: silver__tt_project_metrics
|
||||
tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- tt_project_metrics_id
|
||||
|
||||
columns:
|
||||
- name: inserted_timestamp
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: tt_project_metrics_id
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: silver__tt_project_product_metrics
|
||||
tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- tt_project_product_metrics_id
|
||||
|
||||
columns:
|
||||
- name: inserted_timestamp
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: tt_project_product_metrics_id
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
22
models/token_terminal/silver/silver__tt_projects.yml
Normal file
22
models/token_terminal/silver/silver__tt_projects.yml
Normal file
@ -0,0 +1,22 @@
|
||||
version: 2
|
||||
models:
|
||||
- name: silver__tt_projects
|
||||
tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- tt_projects_id
|
||||
|
||||
columns:
|
||||
- name: inserted_timestamp
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- TIMESTAMP_NTZ
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 2
|
||||
- name: tt_projects_id
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
Loading…
Reference in New Issue
Block a user