adriaparcerisasNFTX user activity 3: no per mi
    Updated 2022-06-12
    WITH
    staked as (
    select
    contract_address,
    count(distinct tx_hash) as n_stakes,
    sum(1) as nfts_staked,
    count(distinct origin_from_address) as n_stakers
    --distinct event_name
    --distinct project_name as "NFT collection",
    --sum(pricen_stakes_usd) as total_volume,
    --count(distinct tx_hash) as n_sales
    from ethereum.core.fact_event_logs
    where block_timestamp>=CURRENT_DATE-60
    and event_name='Transfer' and origin_to_address='0xdc774d5260ec66e5dd4627e1dd800eff3911345c'
    group by 1
    ),
    unstaked as (
    select
    contract_address,
    count(distinct tx_hash) as n_unstakes,
    sum(1) as nfts_unstaked,
    count(distinct origin_from_address) as n_unstakers
    --distinct event_name
    --distinct project_name as "NFT collection",
    --sum(price_usd) as total_volume,
    --count(distinct tx_hash) as n_sales
    from ethereum.core.fact_event_logs
    where block_timestamp>=CURRENT_DATE-60
    and event_name='Transfer' and origin_to_address='0x51d660ba5c218b2cf33fbaca5e3abb8aeff3543b'
    group by 1
    )
    SELECT
    z.name as collection_name,
    x.contract_address as collection_address,
    n_stakes as staking_actions,
    n_unstakes*(-1) as unstaking_actions,
    Run a query to Download Data