mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 20:01:44 +00:00
* add fix gap logic and obs models tests * block height recency test on bitquery table * add tag * upd workflow * explicit cast as int
26 lines
482 B
SQL
26 lines
482 B
SQL
{{ config(
|
|
severity = 'error',
|
|
tags = ['observability']
|
|
) }}
|
|
|
|
WITH check_lag AS (
|
|
|
|
SELECT
|
|
{{ target.database }}.streamline.udf_get_chainhead() AS chainhead,
|
|
(
|
|
SELECT
|
|
MAX(block_height)
|
|
FROM
|
|
{{ ref('silver_observability__block_tx_count') }}
|
|
) AS max_height,
|
|
(
|
|
chainhead - max_height < 25000
|
|
) AS is_recent
|
|
)
|
|
SELECT
|
|
*
|
|
FROM
|
|
check_lag
|
|
WHERE
|
|
NOT is_recent
|