MrftiS05 copy
    Updated 2025-02-08
    -- forked from par_rn / S05 @ https://flipsidecrypto.xyz/par_rn/q/8A6DZDCzwM_s/s05

    SELECT
    date_trunc('day', block_timestamp) AS date,
    CASE
    when contract_name = 'EVK Vault eswETH-1' then 'swETH'
    when contract_name = 'EVK Vault epzETH-1' then 'pzETH'
    when contract_name = 'EVK Vault eweETH-1' then 'weETH'
    when contract_name = 'EVK Vault eezETH-1' then 'ezETH'
    when contract_name = 'EVK Vault eWETH-1' then 'WETH'
    when contract_name = 'EVK Vault ersETH-1' then 'rsETH'
    when contract_name = 'EVK Vault erswETH-1' then 'rswETH'
    when contract_name = 'EVK Vault ewstETH-1' then 'wstETH'
    end AS token,
    event_name,
    COUNT(DISTINCT origin_from_address) AS users,
    SUM(decoded_log:assets / pow(10, 18)) AS amount
    FROM
    swell.core.ez_decoded_event_logs
    WHERE
    event_name IN ('Deposit', 'Borrow', 'Repay', 'Withdraw')
    AND origin_to_address = '0x08739cbede6e28e387685ba20e6409bd16969cde'
    GROUP BY 1,2,3
    order by 1
    Last run: about 1 month ago
    DATE
    TOKEN
    EVENT_NAME
    USERS
    AMOUNT
    AMOUNT_USD
    1
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006670.00260201596
    2
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006677.890284759e-8
    3
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006677.890284759e-8
    4
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006671387.302960232
    5
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006671429.698255478
    6
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006670.002591011705
    7
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006677.890284759e-8
    8
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006671435.703242933
    9
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006670.002589721031
    10
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006671429.069680378
    11
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006677.890284759e-8
    12
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006670.002593316481
    13
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006677.890284759e-8
    14
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006671406.671454314
    15
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006670.002584478715
    16
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006670.002596928692
    17
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006671438.586307392
    18
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006670.002595499731
    19
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006671410.245951383
    20
    2025-01-17 00:00:00.000pzETHWithdraw10.41905006677.890284759e-8
    ...
    15158
    1MB
    6s