John_GaltSCRT/OSMO: Price & Vol
Updated 2022-07-14
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 poolfilter as (select
distinct tx_id,
date(block_timestamp) as date,
msg_index as index
from osmosis.core.fact_msg_attributes
where date(block_timestamp) > '2022-04-12'
--where date(block_timestamp) > DATEADD(month, -3, current_date) --use this later
and msg_type = 'token_swapped'
and attribute_key = 'pool_id'
and attribute_value = 584
),
osmoin as (select --osmoin
SPLIT_PART(attribute_value, 'u', 1) / pow(10, 6) as osmo_in,
tx_id,
msg_index as index
from osmosis.core.fact_msg_attributes
where date(block_timestamp) > '2022-04-12'
and msg_type = 'token_swapped'
and attribute_key = 'tokens_in'
and CONTAINS(attribute_value, 'uosmo')
),
osmoout as (select --osmoout
SPLIT_PART(attribute_value, 'u', 1) / pow(10, 6) as osmo_out,
tx_id,
msg_index as index
from osmosis.core.fact_msg_attributes
where date(block_timestamp) > '2022-04-12'
and msg_type = 'token_swapped'
and attribute_key = 'tokens_out'
and CONTAINS(attribute_value, 'uosmo')
),
osmousd as (select
block_timestamp,
Run a query to Download Data