danielrDaily staked and unstaked
    Updated 2023-06-04
    with A as(
    SELECT
    date_trunc('{{Date_Trunc}}',block_timestamp) as date,
    sum(AMOUNT_USD) as amount,
    'Staked' as type
    from ethereum.core.ez_token_transfers
    where TO_ADDRESS='0x4da27a545c0c5b758a6ba100e3a049001de870f5'
    and ORIGIN_TO_ADDRESS='0x4da27a545c0c5b758a6ba100e3a049001de870f5'
    and block_timestamp >= CURRENT_DATE - {{Period_From_Current_Date}}
    and SYMBOL='AAVE'
    group by 1),
    B as(
    SELECT
    date_trunc('{{Date_Trunc}}',block_timestamp) as date,
    sum(AMOUNT_USD) as amount,
    'Unstaked' as type
    from ethereum.core.ez_token_transfers
    where from_ADDRESS='0x4da27a545c0c5b758a6ba100e3a049001de870f5'
    and ORIGIN_TO_ADDRESS='0x4da27a545c0c5b758a6ba100e3a049001de870f5'
    and block_timestamp >= CURRENT_DATE - {{Period_From_Current_Date}}
    and SYMBOL='AAVE'
    group by 1),
    C as(
    select * from A
    union all
    select * from B
    )
    select * from C

    Run a query to Download Data