sakineh5021-nIQRzBUntitled Query
    Updated 2022-04-18
    with USDC_daily as (
    SELECT balance_date , sum(balance) as TVL

    from ethereum.erc20_balances B
    where balance_date >= '2022-01-01'
    and user_address <> '0x82ccea8020dde8df2932f6920c39e1259ff5eea1'
    and user_address <> '0xad492e78ea607f1ccf1cefaa7ee37871932b1d02'
    and user_address <> '0x8c654ea010cfb5312fc711f05cde3d91a7a8ddbe'
    and symbol like '%/USDC-LINK'
    group by 1)
    ,
    DAI_daily as (
    SELECT balance_date , sum(balance) as TVL
    from ethereum.erc20_balances B
    where balance_date >= '2022-01-01'
    and user_address <> '0x82ccea8020dde8df2932f6920c39e1259ff5eea1'
    and user_address <> '0xad492e78ea607f1ccf1cefaa7ee37871932b1d02'
    and user_address <> '0x8c654ea010cfb5312fc711f05cde3d91a7a8ddbe'
    and symbol like '%/DAI-LINK'
    group by 1)
    ,
    USDT_daily as (
    SELECT balance_date , sum(balance) as TVL

    from ethereum.erc20_balances B
    where balance_date >= '2022-01-01'
    and user_address <> '0x82ccea8020dde8df2932f6920c39e1259ff5eea1'
    and user_address <> '0xad492e78ea607f1ccf1cefaa7ee37871932b1d02'
    and user_address <> '0x8c654ea010cfb5312fc711f05cde3d91a7a8ddbe'
    and symbol like '%/USDT-LINK'
    group by 1)

    SELECT C.balance_date , sum(D.TVL) as DAI , sum(C.TVL) as USDC , sum(T.TVL) as USDT
    from USDC_daily C , USDT_daily T , DAI_daily D
    Run a query to Download Data