permaryDaily Pickaxe Sales
    Updated 2025-04-03
    WITH purchase AS (
    SELECT
    from_address AS player,
    DATE_TRUNC('day', block_timestamp) AS date,
    tx_hash AS hash
    FROM ronin.core.fact_transactions
    WHERE origin_function_signature = '0xefef39a1'
    ),

    pixel_purchase AS (
    SELECT
    tx_hash AS hash,
    SUM(amount) AS pixel_spent -- Summing pixel spent per transaction
    FROM ronin.core.ez_token_transfers
    WHERE contract_address= '0x7eae20d11ef8c779433eb24503def900b9d28ad7'
    GROUP BY 1
    ),

    pickaxe_buys AS (
    SELECT
    tx_hash AS hash,
    SUM(DECODED_LOG:value::FLOAT) AS axes_bought -- Summing axes per transaction
    FROM ronin.core.ez_decoded_event_logs
    WHERE contract_address ='0x9fa2b2b2b314f0486a15c48810b736ae83d5cc53'
    AND topic_0 ='0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62'
    GROUP BY 1
    ),

    buy_data AS (
    SELECT
    p.date,
    p.player AS buyer,
    p.hash,
    COALESCE(pp.pixel_spent, 0) AS pixel_spent,
    COALESCE(a.axes_bought, 0) AS axes_bought
    FROM purchase p
    Last run: 24 days ago
    DATE
    TOTAL_PICKAXE_SALES
    TOTAL_PICKAXES_BOUGHT
    1
    2024-12-15 00:00:00.000216400
    2
    2024-12-16 00:00:00.00016142477400
    3
    2024-12-17 00:00:00.00020804600600
    4
    2024-12-18 00:00:00.00010552703600
    5
    2024-12-19 00:00:00.0005341530000
    6
    2024-12-20 00:00:00.0003991223400
    7
    2024-12-21 00:00:00.000390976200
    8
    2024-12-22 00:00:00.000440969800
    9
    2024-12-23 00:00:00.000138200
    10
    2024-12-24 00:00:00.000517600
    11
    2024-12-25 00:00:00.000737000
    12
    2024-12-26 00:00:00.00044600
    13
    2024-12-27 00:00:00.00041600
    14
    2024-12-28 00:00:00.00062400
    15
    2024-12-29 00:00:00.0002800
    16
    2024-12-30 00:00:00.0001400
    17
    2024-12-31 00:00:00.0001400
    18
    2025-01-01 00:00:00.00072800
    19
    2025-01-02 00:00:00.00031200
    20
    2025-01-03 00:00:00.000216400
    ...
    109
    4KB
    21s