MLDZMNLong and short positions
    Updated 2022-07-01
    with tb1 as (select
    'Long positions' as position,
    count(distinct tx_hash) as count_position,
    count(distinct ORIGIN_FROM_ADDRESS) as count_users,
    sum(AMOUNT_USD) as value_usd
    from ethereum.core.ez_token_transfers
    where CONTRACT_ADDRESS='0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    and FROM_ADDRESS='0x56178a0d5f301baf6cf3e1cd53d9863437345bf9'
    and to_address='0x82c427adfdf2d245ec51d8046b41c4ee87f0d29c'
    and ORIGIN_FUNCTION_SIGNATURE='0x1cff79cd'
    ),

    tb2 as (select
    'Short positions' as position,
    count(distinct tx_hash) as count_position,
    count(distinct ORIGIN_FROM_ADDRESS) as count_users,
    sum(AMOUNT_USD) as value_usd
    from ethereum.core.ez_token_transfers
    where CONTRACT_ADDRESS='0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    and FROM_ADDRESS='0x82c427adfdf2d245ec51d8046b41c4ee87f0d29c'
    and TO_ADDRESS='0x3b4095d5ff0e629972caaa50bd3004b09a1632c5'
    and ORIGIN_FUNCTION_SIGNATURE='0xe56cfbbe')

    select * from tb1
    union all
    select * from tb2
    Run a query to Download Data