avaema9axl
    Updated 2022-11-29
    with total_join as (select count(distinct LIQUIDITY_PROVIDER_ADDRESS) as join_address from osmosis.core.fact_liquidity_provider_actions
    where action ='pool_joined' and currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E' )
    , total_join_daily as (select count(distinct LIQUIDITY_PROVIDER_ADDRESS) as join_address , block_timestamp::date as join_date from osmosis.core.fact_liquidity_provider_actions
    where action ='pool_joined' and currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'
    group by join_date)
    , total_exit as (select count(distinct LIQUIDITY_PROVIDER_ADDRESS) as exit_address from osmosis.core.fact_liquidity_provider_actions
    where action ='pool_exited' and currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E')
    , total_exit_daily as (select count(distinct LIQUIDITY_PROVIDER_ADDRESS) as exit_address , block_timestamp::date as exit_date from osmosis.core.fact_liquidity_provider_actions
    where action ='pool_exited' and currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'
    group by exit_date)
    , joins as (select LIQUIDITY_PROVIDER_ADDRESS as join_address, block_timestamp::date as join_date from osmosis.core.fact_liquidity_provider_actions
    where action ='pool_joined' and currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E' and join_date > CURRENT_DATE - 30 )
    , exist as (select LIQUIDITY_PROVIDER_ADDRESS as exit_address, block_timestamp::date as exit_date from osmosis.core.fact_liquidity_provider_actions
    where action ='pool_exited' and currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E' and exit_date > CURRENT_DATE - 30 )
    , hold_perids as (select count(*),diff from ( select distinct join_address , datediff('day',join_date,exit_date) as diff from joins inner join exist
    on join_address=exit_address
    where join_date < exit_date)
    group by diff)
    , AXL_balance as (select sum(balance/1e6) , date from osmosis.core.fact_daily_balances where currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'
    group by 2
    )
    , osmo_balance as (select sum(balance/1e6) , date from osmosis.core.fact_daily_balances where currency='uosmo'
    group by 2
    )
    , transfer_type as (select count(*),transfer_type from osmosis.core.fact_transfers
    where currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'
    group by transfer_type)
    , transfer_type_daily as (select count(*),transfer_type, block_timestamp::date as transfer_date from osmosis.core.fact_transfers
    where currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'
    group by transfer_type,transfer_date)


    select * from transfer_type_daily
    Run a query to Download Data