mirror of
https://github.com/FlipsideCrypto/stellar-models.git
synced 2026-02-06 14:26:54 +00:00
* added testing strategy * updated recency within tests, added workflows with different lookback vars * changed daily lookback to 1 * modified workflows to include USE_VARS in the env config, modified tests to use modified_timestamp (instead of closed_at) as the recency filter * fixed env variables (switched to vars from secrets) --------- Co-authored-by: Mike Stepanovic <mike.stepanovic@flipsidecrypto.com> Co-authored-by: Eric Laurello <eric.laurello@flipsidecrypto.com>
28 lines
453 B
SQL
28 lines
453 B
SQL
{{ config (
|
|
materialized = 'view',
|
|
tags = ['recent_test']
|
|
) }}
|
|
|
|
WITH last_3_days AS (
|
|
|
|
SELECT
|
|
closed_at
|
|
FROM
|
|
{{ ref("_max_ledger_by_date") }}
|
|
qualify ROW_NUMBER() over (
|
|
ORDER BY
|
|
closed_at DESC
|
|
) = 3
|
|
)
|
|
SELECT
|
|
*
|
|
FROM
|
|
{{ ref('defi__fact_liquidity_pools') }}
|
|
WHERE
|
|
closed_at :: DATE >= (
|
|
SELECT
|
|
closed_at
|
|
FROM
|
|
last_3_days
|
|
)
|