mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 11:26:53 +00:00
* core views * defi schema * bridge test upd * gov schema * nft schema * price schema * move tx count to blocks model * add collection_count_agg to blocks * upd core views to UNION ALL * upd collections cluster_by * upd dim moment metadata to qualify * upd dim moment metadata test * upd core dim contract labels to qualify and silver (cw) to incr * upd str blocks lookback`
65 lines
1.0 KiB
SQL
65 lines
1.0 KiB
SQL
{{ config(
|
|
materialized = 'view',
|
|
tags = ['ez', 'scheduled'],
|
|
meta={
|
|
'database_tags':{
|
|
'table': {
|
|
'PURPOSE': 'STAKING'
|
|
}
|
|
}
|
|
}
|
|
) }}
|
|
|
|
WITH chainwalkers AS (
|
|
|
|
SELECT
|
|
*
|
|
FROM
|
|
{{ ref('silver__staking_actions') }}
|
|
WHERE
|
|
block_height < {{ var(
|
|
'STREAMLINE_START_BLOCK'
|
|
) }}
|
|
),
|
|
streamline AS (
|
|
SELECT
|
|
*
|
|
FROM
|
|
{{ ref('silver__staking_actions_s') }}
|
|
WHERE
|
|
block_height >= {{ var(
|
|
'STREAMLINE_START_BLOCK'
|
|
) }}
|
|
),
|
|
FINAL AS (
|
|
SELECT
|
|
tx_id,
|
|
event_index,
|
|
block_timestamp,
|
|
block_height,
|
|
tx_succeeded,
|
|
delegator,
|
|
action,
|
|
amount,
|
|
node_id
|
|
FROM
|
|
chainwalkers
|
|
UNION ALL
|
|
SELECT
|
|
tx_id,
|
|
event_index,
|
|
block_timestamp,
|
|
block_height,
|
|
tx_succeeded,
|
|
delegator,
|
|
action,
|
|
amount,
|
|
node_id
|
|
FROM
|
|
streamline
|
|
)
|
|
SELECT
|
|
*
|
|
FROM
|
|
FINAL
|