dbrgSONNE-LP_Total_liquidity
    Updated 2023-03-28
    with
    add_LP_TXs as (
    select
    tx.tx_hash,
    tx.block_timestamp,
    tx.to_address as user,
    tx.raw_amount / power(10, 18) as lp_amount
    from
    optimism.core.fact_token_transfers tx
    WHERE
    1 = 1
    and tx.from_address = '0x0000000000000000000000000000000000000000'
    and tx.contract_address = '0xc899c4d73ed8df2ead1543ab915888b0bf7d57a2'
    and tx.block_timestamp >= '{{start_time}}'::date
    and tx.block_timestamp < add_months(
    '{{start_time}}',
    {{duration_in_months}}
    )
    ),
    remove_LP_TXs as (
    select
    tx.tx_hash,
    tx.raw_amount / power(10, 18) as lp_amount
    from
    optimism.core.fact_token_transfers tx
    WHERE
    1 = 1
    and tx.to_address = '0x0000000000000000000000000000000000000000'
    and tx.contract_address = '0xc899c4d73ed8df2ead1543ab915888b0bf7d57a2'
    and tx.block_timestamp >= '{{start_time}}'::date
    and tx.block_timestamp < add_months(
    '{{start_time}}',
    {{duration_in_months}}
    )
    ),
    add_USDc_LP as (
    Run a query to Download Data