granadohoAdd Liquidity
    Updated 2022-02-04
    with pools as (
    select
    pool_name,
    pool_address
    from ethereum.dex_liquidity_pools
    where platform = 'sushiswap'
    ), price as (
    select
    *
    from (
    select
    price,
    symbol,
    ROW_NUMBER() OVER (PARTITION by symbol order by hour desc) col
    from ethereum.token_prices_hourly
    where date(hour) = current_date
    ) a
    where a.col = 1
    ), add_liquidity as (
    select
    c.block_timestamp,
    c.tx_id,
    d.success,
    c.origin_function_signature,
    c.origin_function_name,
    c.from_address,
    a.pool_name,
    a.pool_address,
    c.amount,
    b.symbol,
    c.amount * b.price as amount_usd
    from ethereum.udm_events c
    inner join pools a
    on c.to_address = a.pool_address
    inner join price b
    on b.symbol = c.symbol
    Run a query to Download Data