10BlockchainTOTAL TVL
    Updated 2025-02-21
    WITH daily_pool_snapshots AS (
    SELECT
    LIQUIDITY_POOL_ID,
    DATE_TRUNC('day', BLOCK_TIMESTAMP) AS day_ts,
    ASSET_A_CODE,
    ASSET_A_ISSUER,
    ASSET_A_AMOUNT,
    ASSET_B_CODE,
    ASSET_B_ISSUER,
    ASSET_B_AMOUNT,
    ROW_NUMBER() OVER (
    PARTITION BY LIQUIDITY_POOL_ID, DATE_TRUNC('day', BLOCK_TIMESTAMP)
    ORDER BY BLOCK_TIMESTAMP DESC
    ) AS rn
    FROM stellar.defi.fact_liquidity_pools
    WHERE DELETED = FALSE -- On ignore la colonne TYPE, qui est vide
    ),

    last_snapshots AS (
    -- On ne retient que la dernière ligne du jour pour chaque pool
    SELECT *
    FROM daily_pool_snapshots
    WHERE rn = 1
    ),

    price_data AS (
    SELECT
    DATE_TRUNC('day', HOUR) AS day_ts,
    ASSET_CODE,
    ASSET_ISSUER,
    AVG(PRICE) AS daily_price
    FROM stellar.price.ez_prices_hourly
    GROUP BY 1, 2, 3
    ),

    pool_valued AS (
    Last run: 26 days ago
    DAY_TS
    TVL_USD
    1
    2025-02-21 00:00:00.0009030558.84009093
    2
    2025-02-20 00:00:00.0009127035.40643946
    3
    2025-02-19 00:00:00.0009022879.80434152
    4
    2025-02-18 00:00:00.0008803872.13239457
    5
    2025-02-17 00:00:00.0009010163.29224273
    6
    2025-02-16 00:00:00.0009144386.24336187
    7
    2025-02-15 00:00:00.0009271483.34545814
    8
    2025-02-14 00:00:00.0009247324.37336861
    9
    2025-02-13 00:00:00.0009041774.67045645
    10
    2025-02-12 00:00:00.0008987228.44785828
    11
    2025-02-11 00:00:00.0009030114.78567461
    12
    2025-02-10 00:00:00.0008775545.95388118
    13
    2025-02-09 00:00:00.0008936125.60271948
    14
    2025-02-08 00:00:00.0008943712.59114349
    15
    2025-02-07 00:00:00.0008969908.86696114
    16
    2025-02-06 00:00:00.0009005701.20986005
    17
    2025-02-05 00:00:00.0009110412.22321052
    18
    2025-02-04 00:00:00.0009447020.67755353
    19
    2025-02-03 00:00:00.0009439975.5269273
    20
    2025-02-02 00:00:00.0009689846.33888427
    30
    1KB
    15s