stellar-models/models/tests/recent/test_defi__fact_liquidity_pools.sql
Mike Stepanovic 006e314b5e
Add testing strategy (#4)
* 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>
2025-02-13 13:30:50 -07:00

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
)