-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding jupiter perps txns + ez metrics by chain (#456)
- Loading branch information
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{{ | ||
config( | ||
materialized="table", | ||
snowflake_warehouse="JUPITER", | ||
database="jupiter", | ||
schema="core", | ||
alias="ez_metrics_by_chain", | ||
) | ||
}} | ||
|
||
with | ||
fees_data as ( | ||
select date, fees | ||
from {{ ref("fact_jupiter_fees_silver") }} | ||
), | ||
perps_data as ( | ||
select date, volume, traders, txns | ||
from {{ ref("fact_jupiter_perps_silver")}} | ||
), | ||
price_data as ({{ get_coingecko_metrics("jupiter-exchange-solana") }}) | ||
select | ||
fees_data.date as date, | ||
'solana' as chain, | ||
fees_data.fees as fees, | ||
volume as trading_volume, | ||
traders as unique_traders, | ||
txns, | ||
price, | ||
market_cap, | ||
fdmc | ||
from fees_data | ||
left join perps_data on perps_data.date = fees_data.date | ||
left join price_data on fees_data.date = price_data.date | ||
where fees_data.date < to_date(sysdate()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters