mirror of
https://github.com/FlipsideCrypto/solana-models.git
synced 2026-02-06 13:46:42 +00:00
parent
271c705586
commit
69bb2bd52d
@ -4,46 +4,59 @@
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
{% for model_suffix in ["socean","lido"] %}
|
||||
|
||||
SELECT
|
||||
'{{ model_suffix }}' AS stake_pool_name,
|
||||
tx_id,
|
||||
block_id,
|
||||
block_timestamp,
|
||||
INDEX,
|
||||
succeeded,
|
||||
action,
|
||||
address,
|
||||
stake_pool,
|
||||
amount,
|
||||
'SOL' AS token,
|
||||
COALESCE (
|
||||
{{ 'stake_pool_actions_' ~ model_suffix ~ '_id' }},
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['tx_id','index']
|
||||
) }}
|
||||
) AS fact_stake_pool_actions_id,
|
||||
COALESCE(
|
||||
inserted_timestamp,
|
||||
'2000-01-01'
|
||||
) AS inserted_timestamp,
|
||||
COALESCE(
|
||||
modified_timestamp,
|
||||
'2000-01-01'
|
||||
) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref(
|
||||
'silver__stake_pool_actions_' + model_suffix
|
||||
SELECT
|
||||
'lido' AS stake_pool_name,
|
||||
tx_id,
|
||||
block_id,
|
||||
block_timestamp,
|
||||
INDEX,
|
||||
succeeded,
|
||||
action,
|
||||
address,
|
||||
stake_pool,
|
||||
amount,
|
||||
'SOL' AS token,
|
||||
COALESCE (
|
||||
stake_pool_actions_lido_id,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['tx_id','index']
|
||||
) }}
|
||||
|
||||
{% if not loop.last %}
|
||||
UNION ALL
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
) AS fact_stake_pool_actions_id,
|
||||
COALESCE(
|
||||
inserted_timestamp,
|
||||
'2000-01-01'
|
||||
) AS inserted_timestamp,
|
||||
COALESCE(
|
||||
modified_timestamp,
|
||||
'2000-01-01'
|
||||
) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref(
|
||||
'silver__stake_pool_actions_lido'
|
||||
) }}
|
||||
UNION ALL
|
||||
SELECT
|
||||
'eversol' as stake_pool_name,
|
||||
'socean' AS stake_pool_name,
|
||||
tx_id,
|
||||
block_id,
|
||||
block_timestamp,
|
||||
INDEX,
|
||||
succeeded,
|
||||
action,
|
||||
address,
|
||||
stake_pool,
|
||||
amount,
|
||||
'SOL' AS token,
|
||||
stake_pool_actions_socean_id AS fact_stake_pool_actions_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
FROM
|
||||
{{ ref(
|
||||
'silver__stake_pool_actions_socean_view'
|
||||
) }}
|
||||
UNION ALL
|
||||
SELECT
|
||||
'eversol' AS stake_pool_name,
|
||||
tx_id,
|
||||
block_id,
|
||||
block_timestamp,
|
||||
@ -57,7 +70,7 @@ SELECT
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['tx_id', 'index']
|
||||
) }} AS fact_stake_pool_actions_id,
|
||||
'2000-01-01' as inserted_timestamp,
|
||||
'2000-01-01' AS inserted_timestamp,
|
||||
'2000-01-01' AS modified_timestamp
|
||||
FROM
|
||||
{{ ref(
|
||||
@ -146,7 +159,7 @@ SELECT
|
||||
'SOL' AS token,
|
||||
stake_pool_actions_jito_id AS fact_stake_pool_actions_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
modified_timestamp
|
||||
FROM
|
||||
{{ ref(
|
||||
'silver__stake_pool_actions_jito'
|
||||
|
||||
@ -4,7 +4,9 @@
|
||||
incremental_strategy = 'merge',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date'],
|
||||
merge_exclude_columns = ["inserted_timestamp"],
|
||||
tags = ['scheduled_non_core']
|
||||
tags = ['scheduled_non_core'],
|
||||
full_refresh = false,
|
||||
enabled = false,
|
||||
) }}
|
||||
|
||||
WITH base_stake_pool_events AS (
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
{{ config(
|
||||
materialized = 'view'
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
tx_id,
|
||||
block_id,
|
||||
block_timestamp,
|
||||
index,
|
||||
succeeded,
|
||||
action,
|
||||
stake_pool,
|
||||
stake_pool_withdraw_authority,
|
||||
stake_pool_deposit_authority,
|
||||
address,
|
||||
reserve_stake_address,
|
||||
amount,
|
||||
_inserted_timestamp,
|
||||
_unique_key,
|
||||
stake_pool_actions_socean_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp,
|
||||
_invocation_id
|
||||
FROM
|
||||
{{ source(
|
||||
'solana_silver',
|
||||
'stake_pool_actions_socean'
|
||||
) }}
|
||||
@ -85,6 +85,7 @@ sources:
|
||||
- name: nft_mint_price_other
|
||||
- name: nft_metadata
|
||||
- name: proposal_votes_marinade
|
||||
- name: stake_pool_actions_socean
|
||||
- name: _blocks_tx_count
|
||||
- name: solana_streamline
|
||||
database: solana
|
||||
|
||||
Loading…
Reference in New Issue
Block a user