LittlerData2023-04-20 11:36 AM
Updated 2023-04-20
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with pricet as (
select
date_trunc('day', hour) as hour
,symbol
,avg(price) as price
from crosschain.core.ez_hourly_prices
group by 1,2
union all
select
date_trunc('day', recorded_hour) as hour,
symbol,
avg(price) as price
from osmosis.core.ez_prices
group by 1,2
),
satellite as (
select
date_trunc('hour',block_timestamp) hour
,case when token_address = '0x120ad3e5a7c796349e591f1570d9f7980f4ea9cb' then 'LUNC'
else token_symbol
end as token_symbol
,amount
,source_chain
from axelar.core.ez_satellite
),
joining as (
select
date_trunc('week',hour) date
,sum(amount*price) usd_volume
,token_symbol
from satellite
join pricet using (hour)