mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 17:06:43 +00:00
49 lines
868 B
SQL
49 lines
868 B
SQL
{{ config(
|
|
materialized = 'incremental',
|
|
incremental_strategy = 'delete+insert',
|
|
unique_key = 'complete_token_prices_id',
|
|
cluster_by = ['HOUR::DATE'],
|
|
tags = ['scheduled_non_core']
|
|
) }}
|
|
|
|
SELECT
|
|
HOUR,
|
|
LOWER(
|
|
p.token_address
|
|
) AS token_address,
|
|
asset_id,
|
|
symbol,
|
|
NAME,
|
|
decimals,
|
|
price,
|
|
blockchain,
|
|
blockchain_name,
|
|
blockchain_id,
|
|
is_imputed,
|
|
is_deprecated,
|
|
is_verified,
|
|
provider,
|
|
source,
|
|
_inserted_timestamp,
|
|
inserted_timestamp,
|
|
modified_timestamp,
|
|
complete_token_prices_id,
|
|
_invocation_id
|
|
FROM
|
|
{{ ref(
|
|
'bronze__complete_token_prices'
|
|
) }}
|
|
p
|
|
|
|
{% if is_incremental() %}
|
|
WHERE
|
|
modified_timestamp >= (
|
|
SELECT
|
|
MAX(
|
|
modified_timestamp
|
|
)
|
|
FROM
|
|
{{ this }}
|
|
)
|
|
{% endif %}
|