mhmFlatten pool ids
Updated 2022-07-11Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
›
⌄
with swaps as (
select block_timestamp::date as date, tx_id, trader, l1.label as from_asset, from_amount/pow(10,from_decimal) as from_amt, l2.label as to_asset, to_amount/pow(10,to_decimal) as to_amt, POOL_IDS
from osmosis.core.fact_swaps s
left join osmosis.core.dim_labels l1 on s.from_currency=l1.address
left join osmosis.core.dim_labels l2 on s.to_currency=l2.address
where block_timestamp BETWEEN '2022-05-01' and CURRENT_DATE-1
)
select
s.*,
w.value as pool_id
from
swaps s,
lateral flatten(input => s.POOL_IDS) w
limit 100
Run a query to Download Data