mirror of
https://github.com/FlipsideCrypto/fsc-evm.git
synced 2026-02-06 17:17:04 +00:00
28 lines
547 B
SQL
28 lines
547 B
SQL
{# Log configuration details #}
|
|
{{ log_model_details() }}
|
|
|
|
{{ config(
|
|
materialized = 'ephemeral'
|
|
) }}
|
|
|
|
WITH max_time AS (
|
|
SELECT
|
|
MAX(block_timestamp) AS max_timestamp
|
|
FROM
|
|
{{ ref("core__fact_blocks") }}
|
|
)
|
|
SELECT
|
|
COALESCE(MIN(block_number), 0) AS block_number
|
|
FROM
|
|
{{ ref("core__fact_blocks") }}
|
|
JOIN max_time
|
|
ON block_timestamp BETWEEN DATEADD(
|
|
'hour',
|
|
-25,
|
|
max_timestamp
|
|
)
|
|
AND DATEADD(
|
|
'hour',
|
|
-24,
|
|
max_timestamp
|
|
) |