Moelp stats sushi 13
    Updated 2022-08-24
    with tb1 as (select
    ORIGIN_FROM_ADDRESS,
    min(BLOCK_TIMESTAMP) as dt1,
    sum(EVENT_INPUTS:value/1e18) as valuee_dep
    from
    ethereum.core.fact_event_logs
    where-- tx_hash = '0xecc31457f818db978127f47d61e3457b3a8872358516ac2c3b54e2d229767d42'
    ORIGIN_TO_ADDRESS = '0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f'
    and origin_function_signature in ('0xf305d719', '0xded9382a','0xe8e33700')

    group by 1),

    wit as (select
    ORIGIN_FROM_ADDRESS,
    max(BLOCK_TIMESTAMP) as dt2,
    sum(EVENT_INPUTS:value/1e18) as valuee_wit
    from
    ethereum.core.fact_event_logs
    where-- tx_hash = '0xecc31457f818db978127f47d61e3457b3a8872358516ac2c3b54e2d229767d42'
    ORIGIN_TO_ADDRESS = '0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f'
    and origin_function_signature in ('0xbaa2abde', '0x2195995c', '0x02751cec' )

    group by 1),

    tb2 as (
    SELECT
    ORIGIN_FROM_ADDRESS ,
    TO_address,
    sum(amount_USD) as amount_1
    from ethereum.core.ez_token_transfers
    where tx_hash in (select tx_hash from tb1)
    group by 1,2),

    tbw as (SELECT
    Run a query to Download Data