Skip to content

Commit

Permalink
updating file names
Browse files Browse the repository at this point in the history
  • Loading branch information
SebMelendez01 committed Nov 6, 2024
1 parent 8b92f7f commit 8392a4c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ with
group by timestamp
)
select
distinct TO_CHAR(TO_TIMESTAMP(source_json:timestamp::string / 1000), 'YYYY-MM-DD HH24:MI:SS') as timestamp
distinct to_timestamp(TO_CHAR(TO_TIMESTAMP(source_json:timestamp::string / 1000), 'YYYY-MM-DD HH24:MI:SS')) as timestamp
, source_json:price::float as price
, source_json:size::float as size
, source_json:type::string as type
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{
config(
materialized="table",
snowflake_warehouse="HYPERLIQUID",
database="hyperliquid",
schema="raw",
alias="ez_price_performance",
)
}}

with
prices as (
select
date_trunc('hour', timestamp) as hour
, symbol
, price
, CASE
when date_part('DOW', convert_timezone('UTC', 'America/New_York', timestamp)) IN (0, 6) then 'FALSE'
when convert_timezone('UTC', 'America/New_York', timestamp)::time between '09:00:00' and '15:59:59' then 'TRUE'
else 'FALSE'
END AS nyc_operating_hours
from {{ref('fact_hyperliquid_perp_token_prices')}} t1
)

select
hour
, symbol
, max(price) as high
, min(price) as low
, avg(price) as average
, median(price) as median
, nyc_operating_hours
from prices
group by hour, symbol, nyc_operating_hours
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{
config(
materialized="table",
snowflake_warehouse="HYPERLIQUID",
database="hyperliquid",
schema="raw",
alias="fact_perp_token_prices",
)
}}
with
perp_prices as (
{{
dbt_utils.union_relations(
relations=[
ref("fact_hyperliquid_btc_price"),
ref("fact_hyperliquid_eth_price"),
],
)
}}
)
select
timestamp
, 'DeFi' as category
, 'hyperliquid' as app
, price
, size
, type
, symbol
from perp_prices

0 comments on commit 8392a4c

Please sign in to comment.