kravietzburrow Stablecoin Pool Activity Overview 2
    Updated 2025-03-06
    WITH main AS (
    SELECT
    tx_hash,
    DATE_TRUNC('week', block_timestamp) AS week,
    platform,
    symbol,
    sender_id AS user,
    amount_usd,
    CASE
    WHEN symbol ILIKE ANY ('USDt', 'USDC', 'FRAX') THEN 'Stablecoin Pool'
    ELSE 'Non-Stablecoin Pool'
    END AS pool_type
    FROM
    near.defi.ez_lending
    WHERE
    platform = 'burrow'
    AND actions IN ('deposit', 'increase_collateral')
    ),
    metrics AS (
    SELECT
    week,
    pool_type,
    COUNT(DISTINCT user) AS unique_users,
    COUNT(tx_hash) AS total_transactions,
    SUM(amount_usd) AS total_volume_usd,
    AVG(amount_usd) AS average_amount_usd
    FROM
    main
    WHERE
    week >= '2024-08-01'
    GROUP BY week, pool_type
    )
    SELECT
    week,
    pool_type,
    unique_users,
    QueryRunArchived: QueryRun has been archived