Eman-RazLending Analysis
    Updated 2023-03-15
    with arbitrum as (select date_trunc('month',block_timestamp) as "Date", sum(asset_amount_usd) as "Volume ($USD)", count(distinct tx_hash) as "Lending Count"
    , count(distinct depositor) as "Lender Count", 'Arbitrum' as "Chain"
    from arbitrum.sushi.ez_lending
    where action='Deposit'
    group by 1
    order by 1),
    avalanche as (select date_trunc('month',block_timestamp) as "Date", sum(asset_amount_usd) as "Volume ($USD)", count(distinct tx_hash) as "Lending Count"
    , count(distinct depositor) as "Lender Count", 'Avalanche' as "Chain"
    from avalanche.sushi.ez_lending
    where action='Deposit'
    group by 1
    order by 1),
    ethereum as (select date_trunc('month',block_timestamp) as "Date", sum(amount_usd) as "Volume ($USD)", count(distinct tx_hash) as "Lending Count"
    , count(distinct depositor) as "Lender Count", 'Ethereum' as "Chain"
    from ethereum.sushi.ez_lending
    where action='Deposit'
    group by 1
    order by 1),
    gnosis as (select date_trunc('month',block_timestamp) as "Date", sum(asset_amount_usd) as "Volume ($USD)", count(distinct tx_hash) as "Lending Count"
    , count(distinct depositor) as "Lender Count", 'Gnosis' as "Chain"
    from gnosis.sushi.ez_lending
    where action='Deposit'
    group by 1
    order by 1),
    polygon as (select date_trunc('month',block_timestamp) as "Date", sum(amount_usd) as "Volume ($USD)", count(distinct tx_hash) as "Lending Count"
    , count(distinct depositor) as "Lender Count", 'Polygon' as "Chain"
    from polygon.sushi.ez_lending
    where action='Deposit'
    and tx_hash not in ('0x0c9a289e6a092e40f0c6e774c7f144a9ef741a5be86f776ea3578e32e3c191aa',
    '0xfda2866df4232d1aa82ac2bda046bc5ee5a2485825c08b4ab3bbfb3e7b85ca14','0x960308538932442149b5599e18f234256015456967a9e3b2778fd4598338fb44'
    ,'0xbd46f6231c3aaae3fd915429192ecb0cc7b5308af2a11f2095a2433a019df7f0')
    group by 1
    order by 1)

    select * from arbitrum union all
    select * from avalanche union all
    Run a query to Download Data