Moeflow recent Daily Active User 5 copy
    Updated 2023-05-16
    -- forked from adriaparcerisas / flow recent Daily Active User 5 @ https://flipsidecrypto.xyz/adriaparcerisas/q/flow-daily-active-user-5-jadggF

    WITH
    daus as (
    SELECT
    distinct proposer as users,
    count(distinct trunc(block_timestamp,'day')) as active_days
    from flow.core.fact_transactions where block_timestamp>=current_date-INTERVAL '1 MONTH'
    group by 1
    having active_days>=15
    ),
    daus_2 as (
    select distinct users from daus
    ),
    salesTb as (
    select
    block_timestamp,
    case
    when DECODED_LOG:taker in (select users from daus) then 'DAU'
    else 'other'
    end as type,
    TX_HASH,
    DECODED_LOG:collection as nft_collection,
    DECODED_LOG:price/1e18 as amount,
    DECODED_LOG:maker as seller,
    DECODED_LOG:taker as buyer,
    DECODED_LOG:tokenId as tokenId
    from avalanche.core.ez_decoded_event_logs
    where event_name in ('TakerBid','TakerAsk')
    )




    Run a query to Download Data