Hessishblstr - mints daily in-out
    Updated 2024-05-31

    with blastr as (SELECT DISTINCT TX_HASH as mint_tx
    from blast.core.fact_traces
    where --tx_hash = '0xe44a963b70bba4f109adc2ab035ce17aa036055346478c3ffacab4212ceee767'
    TYPE = 'DELEGATECALL'
    and TO_ADDRESS = '0x3bd493bba0122f13a77a67fb628063700af592d6'),


    all_mints as (SELECT BLOCK_TIMESTAMP as time, ORIGIN_FROM_ADDRESS as minter,
    case when CONTRACT_NAME is null then '?' else CONTRACT_NAME end as collection,
    DECODED_LOG:quantity as minted_nfts, DECODED_LOG:tokenIds as ids, CONTRACT_ADDRESS as addy,
    (DECODED_LOG:value/pow(10,18))/minted_nfts as price ,
    (DECODED_LOG:value/pow(10,18)) as total_cost,
    tx_hash as hash
    from blast.core.ez_decoded_event_logs
    join blastr on mint_tx = tx_hash

    where --tx_hash = '0xe44a963b70bba4f109adc2ab035ce17aa036055346478c3ffacab4212ceee767'
    EVENT_NAME = 'Mint'
    order by 1 desc),


    all_boosts as (SELECT DISTINCT tx_hash , BLOCK_TIMESTAMP as time, DECODED_LOG:user as user,
    collection,
    DECODED_LOG:quantity as boosts_added,
    (DECODED_LOG:value/pow(10,18)) as boost_value ,
    from blast.core.ez_decoded_event_logs
    join all_mints on DECODED_LOG:collection = lower(addy)
    where --tx_hash = '0x30fc49ce4aab69ae8f82ce9976090fb5887d1abd4c4ca2f886681a9d3f8c8034' and
    EVENT_NAME = 'Boost'),

    all_ref as (SELECT BLOCK_TIMESTAMP as time, ORIGIN_FROM_ADDRESS as minter,
    case when CONTRACT_NAME is null then '?' else CONTRACT_NAME end as collection,
    --DECODED_LOG:quantity as minted_nfts,
    DECODED_LOG:tokenId as id,
    (DECODED_LOG:value/pow(10,18)) as price ,