rezarwzAsset Borrow Distribution
    Updated 6 days ago
    with vaults as (
    select
    distinct contract_address as v_a,
    REGEXP_REPLACE(
    contract_name,
    '^EVK Vault e(.*)-\\d+$',
    '\\1'
    ) as extracted_token
    from
    swell.core.ez_decoded_event_logs
    where
    ORIGIN_TO_ADDRESS = '0x08739cbede6e28e387685ba20e6409bd16969cde'
    AND Event_name = 'Deposit'
    ),
    assets_price as (
    select
    date_trunc('day', HOUR) as date,
    symbol,
    median(price) as price
    from
    crosschain.price.ez_prices_hourly
    where
    symbol in (
    select
    distinct upper(extracted_token)
    from
    vaults
    )
    and date_trunc('day', HOUR) = current_Date
    group by
    1,
    2
    ),
    Base_tx as (
    select
    block_timestamp :: date as date,
    Last run: 6 days ago
    ASSET
    Value
    1
    WETH4693910.41532027
    2
    wstETH68788.09064304
    3
    rswETH16190.699737979
    4
    weETH666007.231527309
    5
    ezETH145650.435241301
    6
    rsETH29371.870786122
    7
    swETH4838.409827532
    8
    rUSDC4.22920947e-11
    9
    pzETH-476.383892066
    9
    235B
    4s