SectorMakerDAO - Total Deposits per Wallet (Historical)
    Updated 2023-03-28
    select
    distinct
    'MakerDAO' as Protocol,
    depositor,
    TO_CHAR(sum(amount_deposited*coalesce(price,0)) over(partition by depositor), '$999,999,999,999') as total_deposits,
    100 * sum(amount_deposited*coalesce(price,0)) over(partition by depositor) / sum(amount_deposited*coalesce(price,0)) over() as "% of Total Protocol Deposits"
    from ethereum.maker.ez_deposits a
    left join ethereum.core.fact_hourly_token_prices b on date_trunc('hour',a.BLOCK_TIMESTAMP) = b.hour and a.token_deposited = b.token_address
    where amount_deposited > 0
    and tx_status = 'SUCCESS'
    order by total_deposits desc

    -- select *
    -- --sum(amount_deposited)
    -- from ethereum.maker.ez_deposits
    -- where amount_deposited > 0
    -- and depositor = lower('0x741AA7CFB2c7bF2A1E7D4dA2e3Df6a56cA4131F3')


    Run a query to Download Data