Updated 2025-03-21
    WITH buytx AS (
    SELECT
    tx_hash
    FROM ethereum.core.fact_event_logs
    WHERE contract_address = lower('0xe217E15b3C19cC0427F9492dC3bcfe8220aFAD10') -- buy contract
    AND block_timestamp > '2024-10-10'
    )

    SELECT
    DATE_TRUNC('hour', t.block_timestamp) AS hour,
    SUM(raw_amount / POWER(10, 18)) * 0.015 AS sales_usd, --1WIFI=$0.015
    SUM(raw_amount / POWER(10, 18)) AS token_sold,
    COUNT(DISTINCT t.tx_hash) AS sales,
    COUNT(DISTINCT t.origin_from_address) AS wallets,
    -- Cumulative metrics
    SUM(SUM(raw_amount / POWER(10, 18)) * 0.015)
    OVER (ORDER BY DATE_TRUNC('hour', t.block_timestamp)) AS cumulative_sales_usd,
    SUM(SUM(raw_amount / POWER(10, 18)))
    OVER (ORDER BY DATE_TRUNC('hour', t.block_timestamp)) AS cumulative_token_sold,
    SUM(COUNT(DISTINCT t.tx_hash))
    OVER (ORDER BY DATE_TRUNC('hour', t.block_timestamp)) AS cumulative_sales,
    SUM(COUNT(DISTINCT t.origin_from_address))
    OVER (ORDER BY DATE_TRUNC('hour', t.block_timestamp)) AS cumulative_wallets

    FROM ethereum.core.fact_token_transfers t
    JOIN buytx ON t.tx_hash = buytx.tx_hash
    WHERE t.contract_address = lower('0xdA5e1988097297dCdc1f90D4dFE7909e847CBeF6') -- token contract
    AND t.block_timestamp > '2024-10-10'
    GROUP BY 1
    ORDER BY hour;

    Last run: 24 days ago
    HOUR
    SALES_USD
    TOKEN_SOLD
    SALES
    WALLETS
    CUMULATIVE_SALES_USD
    CUMULATIVE_TOKEN_SOLD
    CUMULATIVE_SALES
    CUMULATIVE_WALLETS
    1
    2024-10-14 00:00:00.00011.545436676769.6957784091111.545436676769.69577840911
    2
    2024-10-14 01:00:00.0004.7313.3333333331116.2454366761083.02911174322
    3
    2024-10-15 12:00:00.0003081166.62609986205411108.406657133912453081182.87153653205412191.43576913411247
    4
    2024-10-15 13:00:00.0002134088.09905058142272539.936706196217995215270.97058712347684731.37247533033046
    5
    2024-10-15 14:00:00.0008266.585152553551105.676836837665223537.55573967348235837.04931133093052
    6
    2024-10-15 15:00:00.000259560.99814496317304066.54299751701675483098.55388463365539903.59230934793219
    7
    2024-10-15 16:00:00.0001653429.67138618110228644.7590796355837136528.22527081475768548.35138841143802
    8
    2024-10-15 17:00:00.000587922.99770472939194866.51364864524287724451.22297554514963414.86503645664230
    9
    2024-10-15 18:00:00.000277466.43316135918497762.21075734984498001917.6561369533461177.07579450644679
    10
    2024-10-15 19:00:00.000298437.92231798419895861.48786563273118300355.57845489553357038.56365953914990
    11
    2024-10-15 20:00:00.000284101.88012127518940125.34141834354038584457.45857616572297163.90507858265393
    12
    2024-10-15 21:00:00.000231439.46234495115429297.48966343863558815896.92092111587726461.39474162125748
    13
    2024-10-15 22:00:00.000179048.24002603911936549.33506933673328994945.16094715599663010.7298165796080
    14
    2024-10-15 23:00:00.000362721.08489600724181405.65973385925229357666.24584316623844416.38954471716602
    15
    2024-10-16 00:00:00.000475795.78074913431719718.71660894644219833462.02659229655564135.10615376357023
    16
    2024-10-16 01:00:00.000258798.76720557517253251.147038336733810092260.7937979672817386.25319180027361
    17
    2024-10-16 02:00:00.000229557.86834231115303857.889487426623910321818.6621402688121244.14267982687600
    18
    2024-10-16 03:00:00.000194355.36466822512957024.31121531629510516174.0268084701078268.45389485847895
    19
    2024-10-16 04:00:00.000177430.36835169611828691.223446430228110693604.3951601712906959.6773488868176
    20
    2024-10-16 05:00:00.000134955.2505953468997016.7063563727425110828559.6457554721903976.38369791608427
    ...
    2216
    234KB
    12s