From c98bea2a9f55a9c67232674823019575deb6ce54 Mon Sep 17 00:00:00 2001 From: Sebastian Melendez Date: Wed, 27 Nov 2024 10:47:55 -0700 Subject: [PATCH] updating rainbow bridge flows --- .../rainbow_bridge/fact_rainbow_bridge_flows.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/models/staging/rainbow_bridge/fact_rainbow_bridge_flows.sql b/models/staging/rainbow_bridge/fact_rainbow_bridge_flows.sql index 726e7c66..fc373acd 100644 --- a/models/staging/rainbow_bridge/fact_rainbow_bridge_flows.sql +++ b/models/staging/rainbow_bridge/fact_rainbow_bridge_flows.sql @@ -10,23 +10,23 @@ with volume_and_fees_by_chain_and_symbol as ( select - date_trunc('hour', block_timestamp) as hour, + block_timestamp::date as date, source_chain, destination_chain, coalesce(c.category, 'Not Categorized') as category, - amount_usd + coalesce(amount_usd, 0) as usd_amount from {{ ref("fact_rainbow_bridge_transfers") }} t left join dim_contracts c on lower(t.token_address) = lower(c.address) and c.chain = 'ethereum' --only using l1token ) select - date_trunc('day', hour) as date, + date, 'rainbow_bridge' as app, source_chain, destination_chain, category, - sum(amount_usd) as amount_usd, + sum(usd_amount) as amount_usd, null as fee_usd from volume_and_fees_by_chain_and_symbol group by 1, 2, 3, 4, 5 -order by date asc, source_chain asc \ No newline at end of file +having amount_usd is not null \ No newline at end of file