adambalatofunft
    Updated 2022-09-03
    with a as (select
    bb.BLOCK_TIMESTAMP,
    bb.TX_HASH,
    bb.ORIGIN_FROM_ADDRESS as buyer ,
    bb.EVENT_INPUTS:from as seller ,
    bb.EVENT_INPUTS:tokenId as token_id,
    bb.CONTRACT_ADDRESS,bb.ORIGIN_FUNCTION_SIGNATURE ,
    aa.RAW_AMOUNT / pow(10,18) as volume

    from
    arbitrum.core.fact_event_logs as bb inner join arbitrum.core.fact_token_transfers as aa
    on bb.ORIGIN_TO_ADDRESS = aa.TO_ADDRESS and aa.tx_hash=bb.tx_hash
    where aa.FROM_ADDRESS='0x0000000000000000000000000000000000000000'
    and EVENT_NAME ='Transfer'
    and TX_STATUS='SUCCESS'
    and BUYER !=SELLER and bb.ORIGIN_TO_ADDRESS=lower('0x7bc8b1b5aba4df3be9f9a32dae501214dc0e4f3f') and TOKEN_ID is not null
    order by 1 desc )

    select
    count(distinct TX_HASH) as txs ,
    count(distinct buyer) as buyers ,
    count(distinct seller) as sellers ,
    count(distinct token_id) as token_id ,
    sum(volume) as volumes ,
    token_id ,
    ORIGIN_FUNCTION_SIGNATURE,
    BLOCK_TIMESTAMP::date as date ,
    CONTRACT_ADDRESS
    from a
    group by date ,token_id ,CONTRACT_ADDRESS,ORIGIN_FUNCTION_SIGNATURE
    order by volumes desc


    Run a query to Download Data