mirror of
https://github.com/FlipsideCrypto/near-models.git
synced 2026-02-06 11:47:00 +00:00
48 lines
984 B
SQL
48 lines
984 B
SQL
{{ config(
|
|
materialized = 'view',
|
|
persist_docs ={ "relation": true,
|
|
"columns": true },
|
|
tags = ['scheduled_non_core']
|
|
) }}
|
|
|
|
SELECT
|
|
HOUR,
|
|
token_address,
|
|
symbol,
|
|
NAME,
|
|
decimals,
|
|
price,
|
|
blockchain,
|
|
FALSE AS is_native,
|
|
is_deprecated,
|
|
is_imputed,
|
|
COALESCE(is_verified, FALSE) AS token_is_verified,
|
|
inserted_timestamp,
|
|
modified_timestamp,
|
|
complete_token_prices_id AS ez_prices_hourly_id
|
|
FROM
|
|
{{ ref('silver__complete_token_prices') }}
|
|
WHERE
|
|
lower(blockchain) IN ('near', 'near protocol')
|
|
UNION ALL
|
|
SELECT
|
|
HOUR,
|
|
NULL AS token_address,
|
|
symbol,
|
|
NAME,
|
|
decimals,
|
|
price,
|
|
blockchain,
|
|
TRUE AS is_native,
|
|
is_deprecated,
|
|
is_imputed,
|
|
TRUE AS token_is_verified,
|
|
inserted_timestamp,
|
|
modified_timestamp,
|
|
complete_native_prices_id AS ez_prices_hourly_id
|
|
FROM
|
|
{{ ref('silver__complete_native_prices') }}
|
|
WHERE
|
|
blockchain = 'near protocol'
|
|
AND symbol = 'NEAR'
|