Mrfti2024-03-16 11:15 PM
    Updated 2024-05-15
    with alll AS
    ((
    with tbl1 AS
    (
    SELECT
    date_trunc (day, BLOCK_TIMESTAMP) as "Date",
    'USDB deposit' as "Action",
    count (origin_from_address) as "Total users",
    count (DISTINCT origin_from_address) as "Total unique users",
    sum (amount) as "Total deposited tokens",
    sum (AMOUNT_USD) as "Total deposited tokens (USD)"
    from blast.core.ez_token_transfers
    where contract_address = '0x4300000000000000000000000000000000000003'
    and origin_to_address = '0x9aecedcd6a82d26f2f86d331b17a1c1676442a87'
    and to_address = '0x9aecedcd6a82d26f2f86d331b17a1c1676442a87'
    and ORIGIN_FUNCTION_SIGNATURE = '0xa0712d68'
    GROUP by 1
    )
    ,tbl2 as
    (
    SELECT
    date_trunc (day, BLOCK_TIMESTAMP) as "Date",
    'USDB withdraw' as "Action",
    count (origin_from_address) as "Total users",
    count (DISTINCT origin_from_address) as "Total unique users",
    sum (amount) as "Total withdrew tokens",
    sum (AMOUNT_USD) as "Total withdrew tokens (USD)"
    from blast.core.ez_token_transfers
    where contract_address = '0x4300000000000000000000000000000000000003'
    and origin_to_address = '0x9aecedcd6a82d26f2f86d331b17a1c1676442a87'
    and from_address = '0x9aecedcd6a82d26f2f86d331b17a1c1676442a87'
    and ORIGIN_FUNCTION_SIGNATURE = '0x852a12e3'
    GROUP by 1
    )

    SELECT