dannyamahDaily Volume By Market Makers
    Updated 2025-05-06
    WITH classified AS (
    SELECT
    date_trunc('hour', block_timestamp) AS hour,
    block_timestamp,
    tx_id,
    e.signers[0] AS market_maker,
    e.signers[1] AS trader,
    instruction:data AS encoded_data,
    utils.udf_base58_to_hex(encoded_data) AS hex_data, -- Decoded Data
    livequery.utils.udf_hex_to_int(to_char(reverse(to_binary(substr(hex_data, 3 + 16, 16))))) as sold_amount,
    instruction:accounts[6] AS sold_token,
    livequery.utils.udf_hex_to_int(to_char(reverse(to_binary(substr(hex_data, 3 + 16 + 16, 16))))) as bought_amount,
    instruction:accounts[8] AS bought_token
    FROM solana.core.fact_events e
    where 1 = 1
    AND succeeded
    AND block_timestamp >= '2024-12-10' -- Cropping to this date because there were very little transactions prior
    AND program_id = '61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH'
    ),

    asset_data AS (
    SELECT
    hour,
    block_timestamp,
    tx_id,
    market_maker,
    trader,
    bought_amount,
    CASE
    WHEN bought_token = 'So11111111111111111111111111111111111111111' THEN 'So11111111111111111111111111111111111111112'
    ELSE bought_token
    END AS bought_token,
    sold_amount,
    CASE
    WHEN sold_token = 'So11111111111111111111111111111111111111111' THEN 'So11111111111111111111111111111111111111112'
    ELSE sold_token
    Last run: 18 days ago
    DAY
    MARKET_MAKER
    DAILY_VOLUME
    1
    2025-05-06 00:00:00.00054Xh....Loph9.738021755
    2
    2025-05-06 00:00:00.000GdcG....ZQGF4410.930789024
    3
    2025-05-06 00:00:00.000EmNP....eJBH20415.297356412
    4
    2025-05-06 00:00:00.0007rhx....bjnQ567030.92130212
    5
    2025-05-06 00:00:00.000378A....uYMG23994.614286265
    6
    2025-05-06 00:00:00.000GjRA....V5Tf10.825334664
    7
    2025-05-06 00:00:00.0004bvs....j9JV2839630.06179033
    8
    2025-05-06 00:00:00.000MfDu....GVWa3145585.4931158
    9
    2025-05-06 00:00:00.0003rA9....vkxn9918.962732636
    10
    2025-05-06 00:00:00.0007y5d....mLW60.1033410667
    11
    2025-05-06 00:00:00.0004GQe....zVqS907687.271003248
    12
    2025-05-06 00:00:00.00096yw....818g68359.370909632
    13
    2025-05-05 00:00:00.0007y5d....mLW6138221.379182149
    14
    2025-05-05 00:00:00.000GjRA....V5Tf7.3385615
    15
    2025-05-05 00:00:00.000378A....uYMG137279.747364481
    16
    2025-05-05 00:00:00.000EmNP....eJBH290297.890271276
    17
    2025-05-05 00:00:00.0001f8d....uskS2822.81936779
    18
    2025-05-05 00:00:00.000GdcG....ZQGF34144.176686908
    19
    2025-05-05 00:00:00.0003rA9....vkxn41232.59730779
    20
    2025-05-05 00:00:00.000MfDu....GVWa23233859.237704
    ...
    1139
    65KB
    60s