adriaparcerisasosmo/wavax pool 3
    Updated 2023-05-07
    WITH
    info as (
    --OSMO / wAVAX
    select
    tx_id,
    block_timestamp,
    case when attribute_value like '%uosmo%' then 'uOSMO'
    else 'wAVAX' end as currency,
    case when msg_type ='pool_joined' then 'deposit'
    when msg_type ='burn' then 'withdraw' end as actions,
    case when currency like '%uOSMO%' then
    SPLIT_PART(TRIM(REGEXP_REPLACE(
    attribute_value,
    '[^[:digit:]]',
    ' ')), ' ', 0)/pow(10,6)
    else SPLIT_PART(TRIM(REGEXP_REPLACE(
    attribute_value,
    '[^[:digit:]]',
    ' ')), ' ', 0)/pow(10,18) end AS amount
    from osmosis.core.fact_msg_attributes
    where
    block_timestamp>='2023-01-22' and
    msg_type in ('pool_joined','burn')
    and
    RIGHT(attribute_value, LENGTH(attribute_value) - LENGTH(SPLIT_PART(TRIM(REGEXP_REPLACE(attribute_value, '[^[:digit:]]', ' ')), ' ', 0))) in ('ibc/6F62F01D913E3FFE472A38C78235B8F021B511BC6596ADFF02615C8F83D3B373','uosmo')
    --weth,wbtc
    -- limit 5
    --and msg_type='token_swapped'
    --and attribute_key in ('tokens_in','tokens_out')
    ),
    deposits as (
    SELECT
    trunc(block_timestamp,'{{granularity}}') as date,
    --currency,
    count(distinct tx_id) as daily_volume,
    Run a query to Download Data