add stargate to complete

This commit is contained in:
Eric Laurello 2025-06-18 13:23:05 -04:00
parent 1b54f97b0d
commit 6bc15f5f8e
2 changed files with 36 additions and 2 deletions

View File

@ -47,7 +47,7 @@ celer AS (
amount AS gross_amount,
NULL AS amount_fee,
amount AS net_amount,
IFF(direction = 'inbound', flow_wallet_address, counterparty) AS destination_address,
IFF(direction = 'inbound', flow_wallet_address, counterparty) AS destination_address,
IFF(direction = 'outbound', flow_wallet_address, counterparty) AS source_address,
IFF(direction = 'inbound', 'flow', blockchain) AS destination_chain,
IFF(direction = 'outbound', 'flow', blockchain) AS source_chain,
@ -66,6 +66,35 @@ WHERE modified_timestamp >= (
)
{% endif %}
),
stargate AS (
SELECT
tx_id,
block_timestamp,
block_height,
bridge_address,
token_address,
gross_amount,
amount_fee,
net_amount,
IFF(direction = 'inbound', flow_wallet_address, null) AS destination_address,
IFF(direction = 'outbound', flow_wallet_address, null) AS source_address,
IFF(direction = 'inbound', 'flow', destination_chain) AS destination_chain,
IFF(direction = 'outbound', 'flow', source_chain) AS source_chain,
platform,
inserted_timestamp,
modified_timestamp,
bridge_startgate_id AS bridge_complete_id
FROM
{{ ref('silver_evm__bridge_stargate_s') }}
{% if is_incremental() %}
WHERE modified_timestamp >= (
SELECT
MAX(modified_timestamp)
FROM
{{ this }}
)
{% endif %}
),
combo AS (
SELECT
*
@ -76,6 +105,11 @@ combo AS (
*
FROM
celer
UNION ALL
SELECT
*
FROM
stargate
)
SELECT
tx_id,

View File

@ -2,7 +2,7 @@
materialized = 'incremental',
incremental_strategy = 'delete+insert',
unique_key = "block_number",
tags = ['silver_bridge','defi','bridge','curated']
tags = ['silver_bridge','defi','bridge','curated','scheduled_non_core']
) }}
WITH base_contracts AS (