elenahooAstroport swap count
Updated 2022-03-28
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
›
⌄
with astroport_labels as (
select
address,
address_name
from terra.labels
where label = 'astroport'
and label_subtype = 'pool'
and address_name like '%LP%'
)
select
date_trunc('day',block_timestamp) as day,
count(distinct tx_id) as swap_count
from terra.msg_events
where event_type = 'from_contract'
and (event_attributes:"0_from" in (select address from astroport_labels)
or
event_attributes:"to" in (select address from astroport_labels)
)
and (event_attributes:"1_action" = 'swap' or event_attributes:"0_action" = 'swap' )
and tx_status = 'SUCCEEDED'
and block_timestamp >= '2021-12-01'
and block_timestamp < CURRENT_DATE
group by day
order by day asc
Run a query to Download Data