saeedmzn[Earlyfans] - Posts distribution by purchased volume
    Updated 2024-08-26
    -- forked from [Earlyfans] - Posts distribution by num_purchasers @ https://flipsidecrypto.xyz/edit/queries/22c1956c-84c7-44ce-8a53-23e221be1eef

    -- forked from [Earlyfans] - posts listed on earlyfans over time @ https://flipsidecrypto.xyz/edit/queries/a0c6dc7c-7be6-4c99-a168-6b5d99ea1cf9

    -- 0x4b17a9318238403ddac8e3a790c3b06d18132bf4 --EARLYFANS contract
    ---0x7135b32e9903bdb4e19a8b1d22fc2038964b8451 --Thruster_LP
    -- 0x7135b32e9903bdb4e19a8b1d22fc2038964b8451 --Early token

    with txns as (
    select BLOCK_TIMESTAMP::date date ,
    ORIGIN_FROM_ADDRESS user ,
    EVENT_NAME ,
    tx_hash ,
    decoded_log:postID postID
    from blast.core.ez_decoded_event_logs
    where CONTRACT_ADDRESS ='0x4b17a9318238403ddac8e3a790c3b06d18132bf4'
    and event_name in ('PostPurchased','PostPurchasedWithValue')--PostPurchased --PostPurchasedWithValue
    ),
    transfers as (
    select tx_hash ,
    symbol ,
    amount ,
    iff(amount_usd is not NULL,amount_usd,amount * 0.02554098355) amount_usd ,
    FROM_ADDRESS,
    TO_ADDRESS,
    ORIGIN_FROM_ADDRESS,
    ORIGIN_TO_ADDRESS,
    postID
    from blast.core.ez_token_transfers join txns using(tx_hash)
    UNION
    select tx_hash ,
    'ETH' symbol ,
    amount ,
    amount_usd,
    FROM_ADDRESS,
    TO_ADDRESS,
    QueryRunArchived: QueryRun has been archived