Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Near: updating rainbow bridge flows #651

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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