Skip to content

Commit

Permalink
Near: updating rainbow bridge flows (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
SebMelendez01 authored Nov 27, 2024
1 parent b5c1873 commit bb72c5f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions models/staging/rainbow_bridge/fact_rainbow_bridge_flows.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
having amount_usd is not null

0 comments on commit bb72c5f

Please sign in to comment.