Yousefi_1994Number of active wallet addresses in the last 3 month
    Updated 2022-06-28
    with active_wallet_by_lp as (
    select
    block_timestamp::date as days,
    from_address as active_wallet
    from thorchain.liquidity_actions
    where block_timestamp >= current_date - 90
    and from_address is not null
    ),
    active_wallet_by_transfers as (
    select
    block_timestamp::date as days,
    from_address as active_wallet
    from thorchain.transfers
    where block_timestamp >= current_date - 90
    ),
    active_wallet_by_swap as (
    select
    block_timestamp::date as days,
    from_address as active_wallet
    from thorchain.swaps
    where block_timestamp >= current_date - 90
    ),
    final_result as (
    select 'LP transaction' as tx_type, * from active_wallet_by_lp
    union
    select 'Token transfer transaction' as tx_type, * from active_wallet_by_transfers
    union
    select 'Swap transaction' as tx_type, * from active_wallet_by_swap
    )

    select
    days,
    tx_type,
    count(distinct active_wallet) as total_active_wallet
    from final_result
    group by days, tx_type
    Run a query to Download Data