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

adding txns (swap) count to trader_joe #468

Merged
merged 1 commit into from
Sep 11, 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
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ with
sum(tvl_by_pool.tvl) as tvl
from tvl_by_pool
group by tvl_by_pool.date, tvl_by_pool.chain
),
daily_txns_data as (
select
date(block_timestamp) as date
, chain
, count(*) as daily_txns
from {{ ref("ez_trader_joe_dex_swaps")}}
group by 1, 2
)
select
tvl_by_chain.date,
Expand All @@ -59,7 +67,9 @@ select
trading_volume_by_chain.trading_fees,
trading_volume_by_chain.unique_traders,
trading_volume_by_chain.gas_cost_native,
trading_volume_by_chain.gas_cost_usd
trading_volume_by_chain.gas_cost_usd,
daily_txns_data.daily_txns as txns
from tvl_by_chain
left join trading_volume_by_chain using(date, chain)
left join daily_txns_data using (date, chain)
where tvl_by_chain.date < to_date(sysdate())
Loading