Anahitauser 7
    Updated 2022-06-14
    select distinct "Vault ID", sum ("Number of Activity")
    from((with remove as (with tx as (select distinct TX_HASH as txs
    from ethereum.core.fact_event_logs
    where ORIGIN_TO_ADDRESS = '0x0fc584529a2aefa997697fafacba5831fac0c22d'
    and event_name = 'Transfer'
    and event_inputs:tokenId is not null)

    select distinct TX_HASH as tot
    from ethereum.core.fact_event_logs
    inner join tx on tx.txs=fact_event_logs.TX_HASH
    where ORIGIN_TO_ADDRESS = '0x0fc584529a2aefa997697fafacba5831fac0c22d'
    and event_name = 'Minted')

    select distinct event_inputs:vaultId as "Vault ID",count(*) as "Number of Activity"
    from ethereum.core.fact_event_logs
    inner join remove on remove.tot=fact_event_logs.TX_HASH
    where event_name = 'FeesReceived'
    group by 1
    order by 2 desc
    )

    union ALL

    (with remove as (with tx as (select distinct TX_HASH as txs
    from ethereum.core.fact_event_logs
    where ORIGIN_TO_ADDRESS = '0x0fc584529a2aefa997697fafacba5831fac0c22d'
    and event_name = 'Transfer'
    and event_inputs:tokenId is not null)

    select distinct TX_HASH as tot
    from ethereum.core.fact_event_logs
    inner join tx on tx.txs=fact_event_logs.TX_HASH
    where ORIGIN_TO_ADDRESS = '0x0fc584529a2aefa997697fafacba5831fac0c22d'
    and event_name = 'Redeemed')

    select distinct event_inputs:vaultId as "Vault ID",count(*) as "Number of Activity"
    Run a query to Download Data