Afonso_Diaz2023-04-06 06:30 PM
Updated 2023-04-06
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
t1 as (
select
recorded_at::date as date,
symbol,
address as currency,
avg(price) as price_usd
from osmosis.core.dim_prices
join osmosis.core.dim_tokens
on project_name = symbol
group by 1, 2, 3
),
t2 as (
select
a.block_timestamp,
symbol,
tx_id,
sender,
receiver,
parse_json(attribute_value):amount/pow(10, decimal) as amount,
price_usd * parse_json(attribute_value):amount/pow(10, decimal) as amount_usd
from osmosis.core.fact_transfers a
join osmosis.core.fact_msg_attributes b
using(tx_id)
join t1
on date = date_trunc('day', a.block_timestamp)
and a.currency = t1.currency
where transfer_type = 'IBC_TRANSFER_OUT'
and receiver like 'quasar%'
and attribute_key = 'packet_data'
)
select
sender,
count(distinct tx_id) as transactions,
Run a query to Download Data