mirror of
https://github.com/FlipsideCrypto/blast-models.git
synced 2026-02-06 16:01:55 +00:00
native transfers table
This commit is contained in:
parent
faf3ea405d
commit
08b97f55f0
@ -1,7 +1,10 @@
|
||||
{{ config(
|
||||
materialized = 'view',
|
||||
persist_docs ={ "relation": true,
|
||||
"columns": true }
|
||||
materialized = 'incremental',
|
||||
incremental_strategy = 'delete+insert',
|
||||
unique_key = 'block_number',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(trace_address, from_address, to_address)",
|
||||
tags = ['non_realtime','reorg']
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
@ -11,7 +14,7 @@ SELECT
|
||||
tx_position,
|
||||
trace_index,
|
||||
identifier, --deprecate
|
||||
{# trace_address, --new column #}
|
||||
trace_address, --new column
|
||||
origin_from_address,
|
||||
origin_to_address,
|
||||
origin_function_signature,
|
||||
@ -22,7 +25,16 @@ SELECT
|
||||
amount_precise,
|
||||
amount_usd,
|
||||
native_transfers_id AS ez_native_transfers_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__native_transfers') }}
|
||||
|
||||
{% if is_incremental() %}
|
||||
AND modified_timestamp > (
|
||||
SELECT
|
||||
COALESCE(MAX(modified_timestamp), '1970-01-01' :: TIMESTAMP) AS modified_timestamp
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
{% endif %}
|
||||
@ -16,6 +16,8 @@ models:
|
||||
description: '{{ doc("blast_trace_index") }}'
|
||||
- name: IDENTIFIER
|
||||
description: '{{ doc("evm_column_deprecation_notice_identifier") }}'
|
||||
- name: TRACE_ADDRESS
|
||||
description: '{{ doc("evm_trace_address") }}'
|
||||
- name: ORIGIN_FROM_ADDRESS
|
||||
description: '{{ doc("blast_origin_from") }}'
|
||||
- name: ORIGIN_TO_ADDRESS
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
incremental_strategy = 'delete+insert',
|
||||
unique_key = 'block_number',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
|
||||
tags = ['non_realtime','reorg']
|
||||
) }}
|
||||
|
||||
@ -14,7 +13,7 @@ WITH eth_base AS (
|
||||
block_number,
|
||||
block_timestamp,
|
||||
identifier, --deprecate
|
||||
{# trace_address, --new column #}
|
||||
trace_address, --new column
|
||||
from_address,
|
||||
to_address,
|
||||
value,
|
||||
@ -84,7 +83,7 @@ SELECT
|
||||
block_number,
|
||||
block_timestamp,
|
||||
identifier, --deprecate
|
||||
{# trace_address, --new column #}
|
||||
trace_address, --new column
|
||||
origin_from_address,
|
||||
origin_to_address,
|
||||
origin_function_signature,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user