Ali3NBLUB Balance of DEX Liquidity Pools in Avalanche
    Updated 14 hours ago
    with pricet as (
    select date_trunc (day,block_timestamp) as date2,
    avg (amount_in_usd/amount_out) as USDPrice
    from avalanche.defi.ez_dex_swaps
    where symbol_in in ('WAVAX','USDC')
    and (symbol_out = 'WINK' or token_out = '0x0f669808d88b2b0b3d23214dcd2a1cc6a8b1b5cd')
    and block_timestamp >= '2025-02-05'
    group by 1),

    poolst as (
    select *
    from avalanche.defi.dim_dex_liquidity_pools
    where tokens:token0 = '0x0f669808d88b2b0b3d23214dcd2a1cc6a8b1b5cd'
    or tokens:token1 = '0x0f669808d88b2b0b3d23214dcd2a1cc6a8b1b5cd'),

    depositst as (
    select initcap(platform) || ' | ' || Pool_name as LP_Name,
    sum (amount) as Deposited_Volume,
    sum (amount*usdprice) as Deposited_Volume_USD
    from avalanche.core.ez_token_transfers t1 join poolst t2 on t1.to_address = t2.pool_address
    left outer join pricet t3 on t1.block_timestamp::Date = t3.date2
    where contract_address = '0x0f669808d88b2b0b3d23214dcd2a1cc6a8b1b5cd'
    group by 1
    order by 2 desc),

    withdrawst as (
    select initcap(platform) || ' | ' || Pool_name as LP_Name,
    sum (amount) as Withdrawn_Volume,
    sum (amount*usdprice) as Withdrawn_Volume_USD
    from avalanche.core.ez_token_transfers t1 join poolst t2 on t1.from_address = t2.pool_address
    left outer join pricet t3 on t1.block_timestamp::date = t3.date2
    where contract_address = '0x0f669808d88b2b0b3d23214dcd2a1cc6a8b1b5cd'
    group by 1
    order by 2 desc)

    select coalesce (t1.lp_name,t2.lp_name) as Liquidity_Pool_Name,
    Last run: about 14 hours agoAuto-refreshes every 24 hours
    LIQUIDITY_POOL_NAME
    WINK_BALANCE
    WINK_BALANCE_USD
    1
    Trader-Joe-V1 | BLUB-WAVAX152441611.555782746959.19039961
    2
    Pharaoh-V2 | BLUB-WAVAX 10000 2005113632.59798747453413.936781401
    3
    Trader-Joe-V2 | BLUB-WAVAX3414282.18587321514642.524706085
    4
    Trader-Joe-V2 | BLUB-USDC304036.54683915913067.884719876
    5
    Pharaoh-V2 | BLUB-avUSD 10000 200275805.0294164723685.475291539
    6
    Pharaoh-V2 | BLUB-USDC 10000 20054513.424136605598.616616564
    7
    Pangolin | BLUB-WAVAX1810.61548928135.429134084
    8
    Trader-Joe-V1 | BLUB-MU974.3887727051159.313590737
    9
    Pharaoh-V2 | BLUB-KET 3000 60168.211784580.7918327461
    10
    Pharaoh-V2 | BLUB-LIL 10000 200161.6198487011.504694552
    11
    Trader-Joe-V1 | BLUB-AMI3.392996601-198.546597482
    12
    Pharaoh-V2 | BLUB-WINK 10000 2002.910383046e-111.818989404e-12
    13
    Pharaoh-V2 | BLUB-WINK 100 10-2.910383046e-11
    14
    Uniswap-V3 | BLUB-WAVAX 10000 200 UNI-V3 LP04.547473509e-13
    15
    Pharaoh-V2 | BLUB-WINK 250 5010906.760068994
    16
    Pharaoh_V1 | BLUB-WAVAX-4.547473509e-130
    17
    Pharaoh-V2 | BLUB-WAVAX 3000 60-5.820766091e-112984.209359649
    17
    1KB
    8s