John_GaltLP Percent Finder
    Updated 2022-06-20
    with poolfilter as (select
    distinct tx_id as tx
    from osmosis.core.fact_msg_attributes
    where date(block_timestamp) between '2022-02-01' and '2022-06-01'
    and (msg_type = 'pool_joined' or msg_type = 'pool_exited')
    and attribute_key = 'pool_id'
    and attribute_value = '604' --osmo - stars
    ),

    atom 1, juno 497, stars 604, scrt 584, akt 3
    addrfilter as (select
    distinct tx_id as tx,
    SPLIT_PART(attribute_value, '/', 1) as address
    from osmosis.core.fact_msg_attributes as o
    inner join poolfilter on o.tx_id = poolfilter.tx
    where msg_type = 'tx'
    and attribute_key = 'acc_seq'
    ),

    mintfilter1 as (select
    address,
    msg_index as index,
    tx_id as tx
    from osmosis.core.fact_msg_attributes as o
    inner join addrfilter on o.tx_id = addrfilter.tx
    where msg_type = 'transfer'
    and attribute_key = 'sender'
    and attribute_value = 'osmo1c9y7crgg6y9pfkq0y8mqzknqz84c3etr0kpcvj' --minter
    ),

    mintfilter2 as (select
    address,
    SPLIT_PART(attribute_value, 'gamm', 1) / pow(10, 18) as mint_amount,
    tx_id as tx
    from osmosis.core.fact_msg_attributes as o
    Run a query to Download Data