Ali3NDately WINK Balance of DEX Liquidity Pools in Avalanche Over Time
    Updated 12 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 = '0x7698a5311da174a95253ce86c21ca7272b9b05f8')
    and block_timestamp >= '2025-02-05'
    group by 1),

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

    depositst as (
    select date_trunc ({{Date_Trunc}},block_timestamp) as date1,
    initcap(platform) || ' | ' || Pool_name as LP_Name,
    sum (amount) as Deposited_Volume,
    sum (amount*usdprice) as Deposited_Volume_USD,
    sum (Deposited_Volume) over (partition by lp_name order by date1) as Cumulative_Deposited_Volume,
    sum (Deposited_Volume_USD) over (partition by lp_name order by date1) as Cumulative_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 = '0x7698a5311da174a95253ce86c21ca7272b9b05f8'
    group by 1,2),

    withdrawst as (
    select date_trunc ({{Date_Trunc}},block_timestamp) as date1,
    initcap(platform) || ' | ' || Pool_name as LP_Name,
    sum (amount) as Withdrawn_Volume,
    sum (amount*usdprice) as Withdrawn_Volume_USD,
    sum (Withdrawn_Volume) over (partition by lp_name order by date1) as Cumulative_Withdrawn_Volume,
    sum (Withdrawn_Volume_USD) over (partition by lp_name order by date1) as Cumulative_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
    Last run: about 12 hours agoAuto-refreshes every 24 hours
    DATE
    LIQUIDITY_POOL_NAME
    WINK_BALANCE
    WINK_BALANCE_USD
    CUMULATIVE_WINK_BALANCE
    CUMULATIVE_WINK_BALANCE_USD
    1
    2025-04-17 00:00:00.000Trader-Joe-V1 | WINK-WAVAX243344.065093839850.44669654437811780.4461453888417197.14595
    2
    2025-04-17 00:00:00.000Pharaoh-V2 | WINK-WAVAX 10000 200105249.195725908367.8282878386384372.5876660928966429.7763937
    3
    2025-04-17 00:00:00.000Pharaoh-V2 | WINK-KET 10000 200100255.682981804350.376798254100255.682981804350.376798254
    4
    2025-04-17 00:00:00.000Trader-Joe-V1 | WINK-AMI273.1034867590.954450884340914.2889135421032.726850516
    5
    2025-04-17 00:00:00.000Trader-Joe-V1 | WINK-NOCHILL41.4222454120.14476380082329.0142739842593289.08778035
    6
    2025-04-17 00:00:00.000Pharaoh-V2 | avUSD-WINK 10000 20027.1390675530.094846489645649.618237542231.356571411
    7
    2025-04-17 00:00:00.000Pangolin | WINK-WAVAX24.8344332710.086792179335049.91378099993.601454279
    8
    2025-04-17 00:00:00.000Trader-Joe-V1 | BNZ-WINK15.3839214940.0537642256535596.77075338851010.658830892
    9
    2025-04-17 00:00:00.000Trader-Joe-V2 | WINK-WAVAX9.0475655120.03161972411172904111.31459573846935.5739134
    10
    2025-04-17 00:00:00.000Trader-Joe-V1 | WINK-MU8.117578520.028369575541895.3844501281835.866720262
    11
    2025-04-17 00:00:00.000Pharaoh_V1 | WINK-NOCHILL7.2629005550.02538261939154.4342340361395.484877285
    12
    2025-04-16 00:00:00.000Trader-Joe-V1 | WINK-WAVAX1161354.741018394199.26436969937568436.3810515888416346.699253
    13
    2025-04-16 00:00:00.000Pharaoh-V2 | WINK-WAVAX 10000 200177134.323677959640.4880677716279123.3919402428966061.9481059
    14
    2025-04-16 00:00:00.000Trader-Joe-V1 | WINK-AMI1035.7243097053.74500575740641.1854267821031.772399631
    15
    2025-04-16 00:00:00.000Pharaoh-V2 | avUSD-WINK 10000 200185.5783937590.671020411920646.863215701742.308068727
    16
    2025-04-16 00:00:00.000Trader-Joe-V1 | WINK-MU68.2174767230.24666297842395929.41456463100377.011993926
    17
    2025-04-16 00:00:00.000Trader-Joe-V1 | WINK-NOCHILL54.7536608540.19798007362287.5920285722593288.94301655
    18
    2025-04-16 00:00:00.000Pangolin | WINK-WAVAX51.9199123350.18773371335025.07934772893.5146621
    19
    2025-04-16 00:00:00.000Trader-Joe-V1 | BNZ-WINK28.2258307870.10205988535581.38683189451010.605066666
    20
    2025-04-16 00:00:00.000Trader-Joe-V2 | WINK-WAVAX-33113.298409164-119.7321449351450375.4740965129517954.7859996
    ...
    701
    80KB
    116s