adriaparcerisasavax nft activity
    Updated 2023-06-05
    WITH
    active_users as (
    SELECT
    trunc(x.block_timestamp,'week') as date,
    project_name,
    count(distinct from_address) as n_users,
    count(distinct x.tx_hash) as txs,
    sum(tx_fee) as fees,
    avg(tx_fee) as avg_tx_fee
    from avalanche.core.fact_transactions x
    join avalanche.core.fact_decoded_event_logs y on x.tx_hash=y.tx_hash
    join avalanche.core.dim_labels z on y.contract_address=z.address
    where label_type='nft'
    group by 1,2
    ),
    tx_per_user as (
    SELECT
    distinct from_address,
    trunc(x.block_timestamp,'week') as date,
    project_name,
    count(distinct x.tx_hash) as transactions
    from avalanche.core.fact_transactions x
    join avalanche.core.fact_decoded_event_logs y on x.tx_hash=y.tx_hash
    join avalanche.core.dim_labels z on y.contract_address=z.address
    where label_type='nft'
    group by 1,2,3
    )
    select x.*,avg(transactions) as avg_txs_per_user
    from active_users x
    join tx_per_user y on x.date=y.date and x.project_name=y.project_name
    where x.date>=current_date-interval '{{Months}} MONTHS'
    and x.project_name<>'opensea'
    group by 1,2,3,4,5,6
    order by 1 asc

    Run a query to Download Data