elsinaCorrelation between profitability vs. length of time of LP Providers
    Updated 2022-08-24
    with pools as (
    select distinct contract_address as pool_address, address_name as pool_name
    from ethereum.core.ez_token_transfers left join ethereum.core.dim_labels
    where from_address = '0x0000000000000000000000000000000000000000' and origin_to_address = '0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f' and address = pool_address
    ),
    liq as (
    select
    origin_from_address as addr,
    min(block_timestamp::date) as min,
    max(block_timestamp::date) as max,
    sum(amount_usd) as add_liquidity,
    0 as remove_liquidity
    from ethereum.core.ez_token_transfers
    where
    origin_to_address = '0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f' and
    origin_function_signature in ('0xe8e33700', '0xf305d719') and
    to_address in (select pool_address from pools) and
    amount_usd is not null
    group by 1

    union all
    select
    origin_from_address as addr,
    min(block_timestamp::date) as min,
    max(block_timestamp::date) as max,
    0 as add_liquidity,
    sum(amount_usd) as remove_liquidity
    from ethereum.core.ez_token_transfers
    where
    --tx_hash = '0xdd76fb0c4be821055c176dfb34740389a581bbeb4e072eb5d8ed75b1632936ef' and
    origin_to_address = '0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f' and
    origin_function_signature in ('0xded9382a') and
    from_address in (select pool_address from pools) and
    amount_usd is not null
    group by 1
    Run a query to Download Data