mirror of
https://github.com/FlipsideCrypto/fsc-evm.git
synced 2026-02-06 11:41:51 +00:00
Merge pull request #462 from FlipsideCrypto/fix/defi-tvl-gold
fix/defi-tvl-gold
This commit is contained in:
commit
c78e5235b5
@ -9,6 +9,7 @@
|
||||
tags = ['gold','defi','tvl','curated_daily']
|
||||
) }}
|
||||
|
||||
WITH tvl_usd AS (
|
||||
SELECT
|
||||
block_date,
|
||||
SUM(
|
||||
@ -20,12 +21,26 @@ SELECT
|
||||
protocol,
|
||||
version,
|
||||
platform,
|
||||
inserted_timestamp,
|
||||
MAX(modified_timestamp) AS modified_timestamp,
|
||||
MAX(inserted_timestamp) AS inserted_timestamp
|
||||
FROM
|
||||
{{ ref('silver_tvl__complete_tvl') }}
|
||||
GROUP BY
|
||||
block_date,
|
||||
protocol,
|
||||
version,
|
||||
platform
|
||||
)
|
||||
SELECT
|
||||
block_date,
|
||||
tvl_usd,
|
||||
protocol,
|
||||
version,
|
||||
platform,
|
||||
modified_timestamp,
|
||||
inserted_timestamp,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['block_date','platform']
|
||||
) }} AS ez_protocol_tvl_id
|
||||
FROM
|
||||
{{ ref('silver_tvl__complete_tvl') }}
|
||||
GROUP BY
|
||||
ALL
|
||||
tvl_usd
|
||||
Loading…
Reference in New Issue
Block a user