mirror of
https://github.com/FlipsideCrypto/aptos-models.git
synced 2026-02-06 15:27:12 +00:00
add is_verified
This commit is contained in:
parent
08b41449ec
commit
20e566f134
@ -13,7 +13,7 @@ SELECT
|
||||
f.symbol,
|
||||
f.name,
|
||||
f.decimals,
|
||||
COALESCE(p.is_verified, FALSE) AS token_is_verified,
|
||||
f.token_is_verified,
|
||||
f.frozen,
|
||||
f.fact_balances_id AS ez_balances_id,
|
||||
f.inserted_timestamp,
|
||||
|
||||
@ -10,6 +10,7 @@ WITH balances_with_last_positive AS (
|
||||
token_address,
|
||||
post_balance,
|
||||
frozen,
|
||||
is_verified,
|
||||
balances_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp,
|
||||
@ -30,6 +31,7 @@ SELECT
|
||||
COALESCE(t.symbol, NULL) AS symbol,
|
||||
t.name,
|
||||
t.decimals,
|
||||
b.is_verified AS token_is_verified,
|
||||
b.frozen,
|
||||
b.balances_id AS fact_balances_id,
|
||||
b.inserted_timestamp,
|
||||
|
||||
@ -178,17 +178,28 @@ filtered_balances AS (
|
||||
AND last_positive_date IS NOT NULL
|
||||
AND DATEDIFF('day', last_positive_date, block_date) <= 3)
|
||||
)
|
||||
),
|
||||
|
||||
verified_tokens AS (
|
||||
SELECT DISTINCT
|
||||
token_address,
|
||||
is_verified
|
||||
FROM {{ ref('price__ez_prices_hourly') }}
|
||||
WHERE is_verified = TRUE
|
||||
)
|
||||
|
||||
SELECT
|
||||
block_date,
|
||||
address,
|
||||
token_address,
|
||||
post_balance,
|
||||
frozen,
|
||||
{{ dbt_utils.generate_surrogate_key(['block_date', 'address', 'token_address']) }} AS balances_id,
|
||||
f.block_date,
|
||||
f.address,
|
||||
f.token_address,
|
||||
f.post_balance,
|
||||
f.frozen,
|
||||
COALESCE(v.is_verified, FALSE) AS is_verified,
|
||||
{{ dbt_utils.generate_surrogate_key(['f.block_date', 'f.address', 'f.token_address']) }} AS balances_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
_inserted_timestamp,
|
||||
f._inserted_timestamp,
|
||||
'{{ invocation_id }}' AS _invocation_id
|
||||
FROM filtered_balances
|
||||
FROM filtered_balances f
|
||||
LEFT JOIN verified_tokens v
|
||||
ON LOWER(f.token_address) = LOWER(v.token_address)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user