Eman-RazStats Over Time
    Updated 2025-05-01
    with final_table as (
    with blend_table as (SELECT
    date_trunc('hour',block_timestamp) as date,
    tx_hash,
    origin_function_signature,
    origin_from_address,
    origin_to_address,
    '0x' || SUBSTR(INPUT, 35, 40) AS token_address, case
    when '0x' || SUBSTR(INPUT, 35, 40)='0x7ec27d448c6437b4dc3561b3b33512680a179c3f' then 'tBTC'
    when '0x' || SUBSTR(INPUT, 35, 40)='0xd68308efbe8330a7bf58276edef51d91316e90b4' then 'USDT'
    when '0x' || SUBSTR(INPUT, 35, 40)='0x5eaa741552d6af40c7bf46467eaf79eea08eea9f' then 'WBTC'
    when '0x' || SUBSTR(INPUT, 35, 40)='0xf08085ed33c0619113ee706fdb4b1b2c96137bee' then 'USDC'
    when '0x' || SUBSTR(INPUT, 35, 40)='0x637e22a1ebbca50ea2d34027c238317fd10003eb' then 'MUSD'
    end as symbol,
    (
    TO_NUMBER(SUBSTR(INPUT, 75, 8), 'XXXXXXXX') * POW(16, 56) +
    TO_NUMBER(SUBSTR(INPUT, 83, 8), 'XXXXXXXX') * POW(16, 48) +
    TO_NUMBER(SUBSTR(INPUT, 91, 8), 'XXXXXXXX') * POW(16, 40) +
    TO_NUMBER(SUBSTR(INPUT, 99, 8), 'XXXXXXXX') * POW(16, 32) +
    TO_NUMBER(SUBSTR(INPUT, 107, 8), 'XXXXXXXX') * POW(16, 24) +
    TO_NUMBER(SUBSTR(INPUT, 115, 8), 'XXXXXXXX') * POW(16, 16) +
    TO_NUMBER(SUBSTR(INPUT, 123, 8), 'XXXXXXXX') * POW(16, 8) +
    TO_NUMBER(SUBSTR(INPUT, 131, 8), 'XXXXXXXX') * POW(16, 0)
    ) AS raw_amount, case
    when '0x' || SUBSTR(INPUT, 35, 40)='0x7ec27d448c6437b4dc3561b3b33512680a179c3f' then 18
    when '0x' || SUBSTR(INPUT, 35, 40)='0xd68308efbe8330a7bf58276edef51d91316e90b4' then 6
    when '0x' || SUBSTR(INPUT, 35, 40)='0x5eaa741552d6af40c7bf46467eaf79eea08eea9f' then 18
    when '0x' || SUBSTR(INPUT, 35, 40)='0xf08085ed33c0619113ee706fdb4b1b2c96137bee' then 6
    when '0x' || SUBSTR(INPUT, 35, 40)='0x637e22a1ebbca50ea2d34027c238317fd10003eb' then 18
    end as decimal, case
    when origin_function_signature='0x617ba037' then 'Supply'
    when origin_function_signature='0xa415bcad' then 'Borrow'
    when origin_function_signature='0x573ade81' then 'Repay'
    when origin_function_signature='0x69328dec' then 'Withdraw'
    end as action_type
    FROM mezo.testnet.fact_traces
    Last run: about 1 month ago
    Date
    ACTION_TYPE
    Number of Transactions
    Number of Users
    Amount of Transactions
    1
    2025-04-08 12:00:00.000Borrow119.9902
    2
    2025-04-08 12:00:00.000Supply11789.55
    3
    2025-04-08 14:00:00.000Withdraw221000.044641
    4
    2025-04-08 14:00:00.000Repay16145819.589789674
    5
    2025-04-08 14:00:00.000Supply285158839133.868365811
    6
    2025-04-08 14:00:00.000Borrow169153287859.135153649
    7
    2025-04-08 15:00:00.000Supply2221162185181.53488338
    8
    2025-04-08 15:00:00.000Repay115202.7269365
    9
    2025-04-08 15:00:00.000Borrow166118111175.295614658
    10
    2025-04-08 15:00:00.000Withdraw8376321.654484
    11
    2025-04-08 16:00:00.000Supply16782520625.85868267
    12
    2025-04-08 16:00:00.000Repay44799.841207105
    13
    2025-04-08 16:00:00.000Borrow11284123495.586676909
    14
    2025-04-08 16:00:00.000Withdraw433277.6023698
    15
    2025-04-08 17:00:00.000Repay76291.021017983
    16
    2025-04-08 17:00:00.000Borrow8464149032.8045921
    17
    2025-04-08 17:00:00.000Withdraw221000.244265
    18
    2025-04-08 17:00:00.000Supply119601477559.126268
    19
    2025-04-08 18:00:00.000Repay974380.480523535
    20
    2025-04-08 18:00:00.000Withdraw331275.9966
    ...
    1860
    102KB
    22s