rezarwz2024-05-27 11:27 AM
    Updated 2024-06-07
    with avg_pr as (
    SELECT
    avg(price) as Avg_price
    FROM
    blast.price.ez_prices_hourly
    where
    token_address = '0x7135b32e9903bdb4e19a8b1d22fc2038964b8451'
    and date_trunc('day', hour) < '2024-05-11'
    ),
    list_post as (
    SELECT
    lo1.tx_hash,
    lo1.block_timestamp,
    lo1.DECODED_LOG:author as author,
    lo1.DECODED_LOG:owner as owner,
    lo1.DECODED_LOG:postID as postID,
    CASE
    when lo2.decoded_log:numOfShare is not null then lo2.decoded_log:numOfShare
    else lo3.decoded_log:numOfShare
    end as numOfShare,
    CASE
    when lo2.decoded_log:value is not null then lo2.decoded_log:value / pow(10, 18)
    else ez.amount
    end as value,
    CASE
    when lo2.decoded_log:value is not null then 'Early'
    else 'ETH'
    end as token,
    CASE
    when lo2.decoded_log:value is not null
    and tk.amount_usd is not null then tk.amount_usd
    when lo2.decoded_log:value is not null
    and tk.amount_usd is null then lo2.decoded_log:value / pow(10, 18) *(
    select
    Avg_price
    from
    QueryRunArchived: QueryRun has been archived