mirror of
https://github.com/FlipsideCrypto/solana-models.git
synced 2026-02-06 13:46:42 +00:00
* wip * wip * add core, clean up * update per pr comments * update incremental config * update logic * FR model * logic update for daily fr * remove model * recency test for token_account_owners * refs and sysdate --------- Co-authored-by: Eric Laurello <eric.laurello@flipsidecrypto.com>
24 lines
448 B
SQL
24 lines
448 B
SQL
{{ config(
|
|
tags = ["test_daily"]
|
|
) }}
|
|
|
|
WITH most_recent_block AS (
|
|
|
|
SELECT
|
|
MAX(start_block_id) AS recent_block_id
|
|
FROM
|
|
{{ ref('silver__token_account_owners') }}
|
|
)
|
|
SELECT
|
|
A.recent_block_id,
|
|
b.block_id,
|
|
b.block_timestamp
|
|
FROM
|
|
most_recent_block A
|
|
LEFT JOIN {{ ref('silver__blocks') }} b
|
|
ON A.recent_block_id = b.block_id
|
|
WHERE
|
|
b.block_timestamp <= (
|
|
SYSDATE() - INTERVAL '12 HOUR'
|
|
)
|