Kurama1. Stride - Liquid and staked OSMO by stOSMO receivers
    Updated 2023-01-12
    with all_receivers as (select distinct receiver as receiver from osmosis.core.fact_transfers
    where tx_succeeded = 'TRUE'
    and transfer_type in ('IBC_TRANSFER_IN')
    and currency = 'ibc/D176154B0C63D1F9C6DCFB4F70349EBF2E2B5A87A05902F57A6AE92B863E9AEC'
    )

    select date, currency, balance_type, sum(balance/pow(10, decimal)) from osmosis.core.fact_daily_balances
    where 1 = 1
    and address in (select * from all_receivers)
    and currency in ('uosmo')
    and balance_type in ('staked','liquid')
    and date >= (select min(to_date(block_timestamp)) from osmosis.core.fact_transfers
    where tx_succeeded = 'TRUE'
    and transfer_type in ('IBC_TRANSFER_IN')
    and currency = 'ibc/D176154B0C63D1F9C6DCFB4F70349EBF2E2B5A87A05902F57A6AE92B863E9AEC') - 30
    group by date, currency, balance_type


    Run a query to Download Data