dannyamahDaily Volume By Market Makers
    Updated 4 days ago
    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: 4 days ago
    DAY
    MARKET_MAKER
    DAILY_VOLUME
    1
    2025-06-13 00:00:00.000378A....uYMG72088.896746665
    2
    2025-06-13 00:00:00.000EjwY....72yp10165.234695859
    3
    2025-06-13 00:00:00.0003rA9....vkxn34404.248995861
    4
    2025-06-13 00:00:00.0009Sdq....1X8p28040.157896362
    5
    2025-06-13 00:00:00.0009BB7....mUPG2044.693074894
    6
    2025-06-13 00:00:00.000GjRA....V5Tf461276.536579918
    7
    2025-06-13 00:00:00.000AasQ....GmDX622078.972882803
    8
    2025-06-13 00:00:00.000MfDu....GVWa11485896.3988974
    9
    2025-06-13 00:00:00.000CH8p....4Hkz54123.147295363
    10
    2025-06-13 00:00:00.0006nv3....pKLu1761.195870744
    11
    2025-06-13 00:00:00.000BMnT....3iLJ2611197.35951157
    12
    2025-06-13 00:00:00.000Cifh....e5dD1824681.04265015
    13
    2025-06-13 00:00:00.0008Ugt....zofY24849.567433216
    14
    2025-06-13 00:00:00.0007rhx....bjnQ5461764.95684289
    15
    2025-06-13 00:00:00.0004GQe....zVqS3223015.49703577
    16
    2025-06-12 00:00:00.000CH8p....4Hkz243327.272846488
    17
    2025-06-12 00:00:00.000EjwY....72yp11051.404876056
    18
    2025-06-12 00:00:00.0006nv3....pKLu6098.604641108
    19
    2025-06-12 00:00:00.0007rhx....bjnQ6679155.523279
    20
    2025-06-12 00:00:00.000GgWT....L9gV19.979565791
    ...
    1715
    99KB
    52s