tkvresearchInscriptions
    Updated 2023-12-20
    with

    A as (
    select 'Ethereum' as chain, block_timestamp, tx_hash, from_address, tx_fee, input_data from ethereum.core.fact_transactions union all
    select 'Arbitrum' as chain, block_timestamp, tx_hash, from_address, tx_fee, input_data from arbitrum.core.fact_transactions union all
    select 'Optimism' as chain, block_timestamp, tx_hash, from_address, tx_fee, input_data from optimism.core.fact_transactions union all
    select 'Avalanche' as chain, block_timestamp, tx_hash, from_address, tx_fee, input_data from avalanche.core.fact_transactions union all
    select 'Polygon' as chain, block_timestamp, tx_hash, from_address, tx_fee, input_data from polygon.core.fact_transactions union all
    select 'Base' as chain, block_timestamp, tx_hash, from_address, tx_fee, input_data from base.core.fact_transactions union all
    select 'BNB chain' as chain, block_timestamp, tx_hash, from_address, tx_fee, input_data from bsc.core.fact_transactions
    )


    select date_trunc('week',block_timestamp) as time, chain,
    case when substr(input_data,0,55) = '0x646174613a2c7b2270223a226173632d3230222c226f70223a226' then 'Inscription' else 'Non Inscription' end as type,
    count(distinct tx_hash) as txs,
    count(distinct from_address) as user,
    sum(tx_fee) as fees
    from A
    where date(block_timestamp) > date('2023-10-01')
    group by 1,2,3
    order by 1 desc, type desc



    QueryRunArchived: QueryRun has been archived