add signer

This commit is contained in:
tarikceric 2025-11-18 20:21:54 +01:00
parent 226615c4e6
commit 09c80ee491
3 changed files with 23 additions and 1 deletions

View File

@ -26,6 +26,7 @@ WITH liquid_staking_actions AS (
tx_id,
index,
inner_index,
signer,
action_type,
provider_address,
deposit_amount,
@ -59,6 +60,7 @@ SELECT
a.tx_id,
a.index,
a.inner_index,
a.signer,
a.action_type,
a.provider_address,
a.deposit_amount,

View File

@ -40,6 +40,11 @@ models:
description: "{{ doc('inner_index') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: SIGNER
description: "{{ doc('signer') }}"
tests:
- dbt_expectations.expect_column_to_exist
- not_null: *recent_date_filter
- name: ACTION_TYPE
description: "{{ doc('action') }}"
tests:

View File

@ -13,7 +13,16 @@
{% set base_query %}
CREATE OR REPLACE TEMPORARY TABLE silver.marinade_liquid_staking_actions__intermediate_tmp AS
SELECT
*
block_id,
block_timestamp,
tx_id,
index,
inner_index,
signers[0]::STRING AS signer,
program_id,
decoded_instruction,
event_type,
_inserted_timestamp
FROM
{{ ref('silver__decoded_instructions_combined') }}
WHERE
@ -100,6 +109,7 @@ deposits AS (
a.tx_id,
a.index,
a.inner_index,
a.signer,
a.event_type AS action_type,
CASE
WHEN a.event_type = 'deposit' THEN silver.udf_get_account_pubkey_by_name('transferFrom', decoded_instruction:accounts)
@ -134,6 +144,7 @@ order_unstakes AS (
tx_id,
index,
inner_index,
signer,
event_type AS action_type,
silver.udf_get_account_pubkey_by_name('burnMsolAuthority', decoded_instruction:accounts) AS provider_address,
(decoded_instruction:args:msolAmount::int) * pow(10, -9) AS msol_burned,
@ -151,6 +162,7 @@ claims AS (
a.tx_id,
a.index,
a.inner_index,
a.signer,
a.event_type AS action_type,
silver.udf_get_account_pubkey_by_name('transferSolTo', a.decoded_instruction:accounts) AS provider_address,
b.amount AS claim_amount,
@ -175,6 +187,7 @@ SELECT
tx_id,
index,
inner_index,
signer,
action_type,
provider_address,
deposit_amount,
@ -196,6 +209,7 @@ SELECT
tx_id,
index,
inner_index,
signer,
action_type,
provider_address,
NULL AS deposit_amount,
@ -217,6 +231,7 @@ SELECT
tx_id,
index,
inner_index,
signer,
action_type,
provider_address,
NULL AS deposit_amount,