diff --git a/models/projects/ton/core/ez_ton_metrics.sql b/models/projects/ton/core/ez_ton_metrics.sql index c565e047..7f2ed125 100644 --- a/models/projects/ton/core/ez_ton_metrics.sql +++ b/models/projects/ton/core/ez_ton_metrics.sql @@ -26,12 +26,6 @@ with ), price_data as ({{ get_coingecko_metrics("the-open-network") }}), defillama_data as ({{ get_defillama_metrics("ton") }}), - dex_data as ( - select - date, - dex_volumes - from {{ ref("fact_ton_dex_volumes") }} - ), stablecoin_data as ({{ get_stablecoin_metrics("ton") }}), github_data as ({{ get_github_metrics("ton") }}), rolling_metrics as ({{ get_rolling_active_address_metrics("ton") }}) @@ -58,7 +52,6 @@ select market_cap, fdmc, tvl, - dex_data.dex_volumes, weekly_commits_core_ecosystem, weekly_commits_sub_ecosystem, weekly_developers_core_ecosystem, @@ -76,7 +69,6 @@ from ton_apps_fundamental_data as ton left join price_data on ton.date = price_data.date left join defillama_data on ton.date = defillama_data.date left join github_data on ton.date = github_data.date -left join dex_data on ton.date = dex_data.date left join fundamental_data on ton.date = fundamental_data.date left join stablecoin_data on ton.date = stablecoin_data.date left join rolling_metrics on ton.date = rolling_metrics.date diff --git a/models/staging/ton/__ton__sources.yml b/models/staging/ton/__ton__sources.yml index 8c0448dd..06ef6179 100644 --- a/models/staging/ton/__ton__sources.yml +++ b/models/staging/ton/__ton__sources.yml @@ -7,7 +7,6 @@ sources: - name: raw_ton_gas - name: raw_ton_revenue - name: raw_ton_txns - - name: raw_ton_dex_volumes - name: raw_ton_stablecoin_transfers - name: raw_ton_apps_openleague - name: raw_ton_tokens_openleague diff --git a/models/staging/ton/fact_ton_dex_volumes.sql b/models/staging/ton/fact_ton_dex_volumes.sql deleted file mode 100644 index e983ad20..00000000 --- a/models/staging/ton/fact_ton_dex_volumes.sql +++ /dev/null @@ -1,32 +0,0 @@ --- Defillama currently doesn't support the correct DEX volumes --- Missing DeDust Dex Voluems -with - max_extraction as ( - select - max(extraction_date) as max_extraction, - value:date::date as date - from {{ source("PROD_LANDING", "raw_ton_dex_volumes" ) }}, - lateral flatten(input => source_json) - group by date - ), - flattened_data as ( - select value:"date"::date as date, value:"dex_volumes"::float as dex_volumes, extraction_date - from {{ source("PROD_LANDING", "raw_ton_dex_volumes" ) }}, - lateral flatten(input => source_json) - ), - prices as ({{ get_coingecko_price_with_latest("the-open-network") }}) -select - t1.date, - 'ton' as chain, - case - -- Historical pull is from tonStats which has shows dex volumes in TON - when t1.date <= '2024-05-25' then dex_volumes * price - --https://api.redoubt.online/dapps/v1/export/defi/ston.fi - --https://api.redoubt.online/dapps/v1/export/defi/dedust - --Daily pull to get the dex volume in USD - --Endpoints supplied by the TON team - else dex_volumes - end as dex_volumes -from flattened_data t1 -inner join max_extraction t2 on t1.date = t2.date and t1.extraction_date = t2.max_extraction -left join prices on t1.date = prices.date