mirror of
https://github.com/FlipsideCrypto/gnosis-models.git
synced 2026-02-06 11:41:50 +00:00
* vars, readme, tx_success * defi heal logic * lookbacks on lps * var format * heal logic * dex swaps heal * pool name * column names
63 lines
1.4 KiB
SQL
63 lines
1.4 KiB
SQL
{{ config(
|
|
materialized = 'view',
|
|
persist_docs ={ "relation": true,
|
|
"columns": true },
|
|
meta ={
|
|
'database_tags':{
|
|
'table':{
|
|
'PROTOCOL': 'CELER, HOP, MESON',
|
|
'PURPOSE': 'BRIDGE'
|
|
} } }
|
|
) }}
|
|
|
|
SELECT
|
|
block_number,
|
|
block_timestamp,
|
|
origin_from_address,
|
|
origin_to_address,
|
|
origin_function_signature,
|
|
tx_hash,
|
|
event_index,
|
|
bridge_address,
|
|
event_name,
|
|
platform,
|
|
sender,
|
|
receiver,
|
|
destination_chain_receiver,
|
|
COALESCE(
|
|
standard_destination_chain,
|
|
b.destination_chain
|
|
) AS destination_chain,
|
|
destination_chain_id,
|
|
token_address,
|
|
token_symbol,
|
|
amount_unadj,
|
|
amount,
|
|
ROUND(
|
|
CASE
|
|
WHEN amount_usd < 1e+15 THEN amount_usd
|
|
ELSE NULL
|
|
END,
|
|
2
|
|
) AS amount_usd,
|
|
COALESCE (
|
|
complete_bridge_activity_id,
|
|
{{ dbt_utils.generate_surrogate_key(
|
|
['_id']
|
|
) }}
|
|
) AS ez_bridge_activity_id,
|
|
COALESCE(
|
|
inserted_timestamp,
|
|
'2000-01-01'
|
|
) AS inserted_timestamp,
|
|
COALESCE(
|
|
modified_timestamp,
|
|
'2000-01-01'
|
|
) AS modified_timestamp
|
|
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
|
|
|