mirror of
https://github.com/FlipsideCrypto/polygon-models.git
synced 2026-02-06 13:22:04 +00:00
add (#457)
This commit is contained in:
parent
64f4d27237
commit
2db1c99039
@ -102,6 +102,10 @@ models:
|
||||
+enabled: false
|
||||
stats:
|
||||
+enabled: true
|
||||
defi:
|
||||
+enabled: false
|
||||
bridge:
|
||||
+enabled: true
|
||||
scores_package:
|
||||
+enabled: true
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ SELECT
|
||||
receiver,
|
||||
destination_chain_receiver,
|
||||
COALESCE(
|
||||
standard_destination_chain,
|
||||
c.standardized_name,
|
||||
b.destination_chain
|
||||
) AS destination_chain,
|
||||
destination_chain_id,
|
||||
@ -41,6 +41,7 @@ SELECT
|
||||
END,
|
||||
2
|
||||
) AS amount_usd,
|
||||
token_is_verified,
|
||||
COALESCE (
|
||||
complete_bridge_activity_id,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
@ -58,5 +59,5 @@ SELECT
|
||||
FROM
|
||||
{{ ref('silver_bridge__complete_bridge_activity') }}
|
||||
b
|
||||
LEFT JOIN {{ ref('silver_bridge__standard_dst_chain_seed') }} C
|
||||
ON b.destination_chain = C.destination_chain
|
||||
LEFT JOIN {{ ref('silver_bridge__standard_chain_seed') }} C
|
||||
ON b.destination_chain = C.variation
|
||||
|
||||
@ -46,6 +46,8 @@ models:
|
||||
description: '{{ doc("evm_bridge_amount") }}'
|
||||
- name: AMOUNT_USD
|
||||
description: '{{ doc("evm_bridge_amount_usd") }}'
|
||||
- name: TOKEN_IS_VERIFIED
|
||||
description: '{{ doc("evm_bridge_token_is_verified") }}'
|
||||
- name: EZ_BRIDGE_ACTIVITY_ID
|
||||
description: '{{ doc("evm_pk") }}'
|
||||
- name: INSERTED_TIMESTAMP
|
||||
|
||||
@ -370,6 +370,44 @@ WHERE
|
||||
)
|
||||
{% endif %}
|
||||
),
|
||||
|
||||
layerzero_v2 AS (
|
||||
SELECT
|
||||
block_number,
|
||||
block_timestamp,
|
||||
origin_from_address,
|
||||
origin_to_address,
|
||||
origin_function_signature,
|
||||
tx_hash,
|
||||
event_index,
|
||||
bridge_address,
|
||||
event_name,
|
||||
platform,
|
||||
version,
|
||||
sender,
|
||||
receiver,
|
||||
destination_chain_receiver,
|
||||
destination_chain_id :: STRING AS destination_chain_id,
|
||||
destination_chain,
|
||||
token_address,
|
||||
NULL AS token_symbol,
|
||||
amount_unadj,
|
||||
_log_id AS _id,
|
||||
inserted_timestamp AS _inserted_timestamp
|
||||
FROM
|
||||
{{ ref('silver_bridge__layerzero_v2') }}
|
||||
|
||||
{% if is_incremental() and 'layerzero_v2' not in var('HEAL_MODELS') %}
|
||||
WHERE
|
||||
_inserted_timestamp >= (
|
||||
SELECT
|
||||
MAX(_inserted_timestamp) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}'
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
{% endif %}
|
||||
),
|
||||
|
||||
meson AS (
|
||||
SELECT
|
||||
block_number,
|
||||
@ -478,6 +516,44 @@ WHERE
|
||||
)
|
||||
{% endif %}
|
||||
),
|
||||
|
||||
stargate_v2 AS (
|
||||
SELECT
|
||||
block_number,
|
||||
block_timestamp,
|
||||
origin_from_address,
|
||||
origin_to_address,
|
||||
origin_function_signature,
|
||||
tx_hash,
|
||||
event_index,
|
||||
bridge_address,
|
||||
event_name,
|
||||
platform,
|
||||
version,
|
||||
sender,
|
||||
receiver,
|
||||
destination_chain_receiver,
|
||||
destination_chain_id :: STRING AS destination_chain_id,
|
||||
destination_chain,
|
||||
token_address,
|
||||
NULL AS token_symbol,
|
||||
amount_unadj,
|
||||
_log_id AS _id,
|
||||
inserted_timestamp AS _inserted_timestamp
|
||||
FROM
|
||||
{{ ref('silver_bridge__stargate_v2') }}
|
||||
|
||||
{% if is_incremental() and 'stargate_v2' not in var('HEAL_MODELS') %}
|
||||
WHERE
|
||||
_inserted_timestamp >= (
|
||||
SELECT
|
||||
MAX(_inserted_timestamp) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}'
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
{% endif %}
|
||||
),
|
||||
|
||||
symbiosis AS (
|
||||
SELECT
|
||||
block_number,
|
||||
@ -673,6 +749,11 @@ all_protocols AS (
|
||||
FROM
|
||||
hop
|
||||
UNION ALL
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
layerzero_v2
|
||||
UNION ALL
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
@ -688,6 +769,11 @@ all_protocols AS (
|
||||
FROM
|
||||
stargate
|
||||
UNION ALL
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
stargate_v2
|
||||
UNION ALL
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
@ -730,7 +816,9 @@ complete_bridge_activity AS (
|
||||
'wormhole-v1',
|
||||
'meson-v1',
|
||||
'allbridge-v2',
|
||||
'chainlink-ccip-v1'
|
||||
'chainlink-ccip-v1',
|
||||
'layerzero-v2',
|
||||
'stargate-v2'
|
||||
) THEN destination_chain_id :: STRING
|
||||
WHEN d.chain_id IS NULL THEN destination_chain_id :: STRING
|
||||
ELSE d.chain_id :: STRING
|
||||
@ -741,7 +829,9 @@ complete_bridge_activity AS (
|
||||
'wormhole-v1',
|
||||
'meson-v1',
|
||||
'allbridge-v2',
|
||||
'chainlink-ccip-v1'
|
||||
'chainlink-ccip-v1',
|
||||
'layerzero-v2',
|
||||
'stargate-v2'
|
||||
) THEN LOWER(destination_chain)
|
||||
WHEN d.chain IS NULL THEN LOWER(destination_chain)
|
||||
ELSE LOWER(
|
||||
@ -769,6 +859,7 @@ complete_bridge_activity AS (
|
||||
)
|
||||
ELSE NULL
|
||||
END AS amount_usd,
|
||||
p.is_verified as token_is_verified,
|
||||
_id,
|
||||
b._inserted_timestamp
|
||||
FROM
|
||||
@ -828,6 +919,7 @@ heal_model AS (
|
||||
WHEN C.token_decimals IS NOT NULL THEN amount_heal * p.price
|
||||
ELSE NULL
|
||||
END AS amount_usd_heal,
|
||||
p.is_verified as token_is_verified,
|
||||
_id,
|
||||
t0._inserted_timestamp
|
||||
FROM
|
||||
@ -965,6 +1057,7 @@ SELECT
|
||||
amount_unadj,
|
||||
amount_heal AS amount,
|
||||
amount_usd_heal AS amount_usd,
|
||||
token_is_verified,
|
||||
_id,
|
||||
_inserted_timestamp
|
||||
FROM
|
||||
@ -994,6 +1087,7 @@ SELECT
|
||||
amount_unadj,
|
||||
amount,
|
||||
amount_usd,
|
||||
token_is_verified,
|
||||
_id,
|
||||
_inserted_timestamp,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
packages:
|
||||
- git: https://github.com/FlipsideCrypto/fsc-evm.git
|
||||
revision: v4.3.0
|
||||
revision: v4.5.0
|
||||
Loading…
Reference in New Issue
Block a user