datavortexenchanting-coffee
    Updated 2025-02-08
    WITH Deposits AS (
    SELECT
    contract_name,
    contract_address,
    CASE
    WHEN decoded_log:wad IS NOT NULL
    THEN (decoded_log:wad::int)
    WHEN decoded_log:assets IS NOT NULL
    THEN CAST(PARSE_JSON(decoded_log:assets)[0] AS BIGINT)
    END AS deposit_amount
    FROM swell.core.ez_decoded_event_logs
    WHERE event_name IN ('Deposit', 'Deposits')
    ),

    Withdrawals AS (
    SELECT
    contract_name,
    contract_address,
    CASE
    WHEN decoded_log:wad IS NOT NULL
    THEN (decoded_log:wad::int)
    WHEN decoded_log:assets IS NOT NULL
    THEN CAST(PARSE_JSON(decoded_log:assets)[0] AS BIGINT)
    END AS withdrawal_amount
    FROM swell.core.ez_decoded_event_logs
    WHERE event_name IN ('Withdraw', 'Withdrawal')
    ),

    prices AS (
    SELECT
    LOWER(name) AS name,
    LOWER(symbol) AS symbol,
    price,
    decimals,
    ROW_NUMBER() OVER (PARTITION BY LOWER(symbol) ORDER BY hour DESC) AS rn
    FROM ethereum.price.ez_prices_hourly
    Last run: 3 months ago
    ASSET
    TOTAL_DEPOSITS_USD
    TOTAL_WITHDRAWALS_USD
    NET_FLOW_USD
    1
    Wrapped Ether13701374.9518163096329.5557544410605045.3960616
    2
    tsPzethEzeth125121.727272880125121.72727288
    3
    tsWeethRsETH99232.7851346099232.7851346
    4
    tsEnaUsde14487.192268014487.192268
    5
    tsSwellETH0.0860510762800.08605107628
    6
    veNFT000
    7
    EVK Vault eweETH-1000
    8
    EVK Vault eswETH-1000
    9
    EVK Vault erswETH-1000
    10
    EVK Vault ewstETH-1000
    11
    EVK Vault eezETH-1000
    12
    EVK Vault eWETH-1000
    13
    EVK Vault epzETH-1000
    14
    EVK Vault ersETH-1000
    14
    503B
    4s