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