Specterrepay distribution of tx
    Updated 2025-03-24
    WITH tx_counts AS (
    SELECT
    payer,
    COUNT(*) AS total_tx
    FROM avalanche.defi.ez_lending_repayments
    WHERE contract_address = '0x794a61358d6845594f94dc1db02a252b5b4814ad'
    AND origin_to_address = '0x794a61358d6845594f94dc1db02a252b5b4814ad'
    AND token_symbol IN ('USDC', 'AUSD', 'USDt', 'DAI.e', 'FRAX')
    AND platform = 'Aave V3'
    AND event_name = 'Repay'
    AND block_timestamp >= '2024-01-01'
    GROUP BY payer
    )
    SELECT
    CASE
    WHEN total_tx = 1 THEN '1 Transaction'
    WHEN total_tx BETWEEN 2 AND 5 THEN '2-5 Transactions'
    WHEN total_tx BETWEEN 6 AND 10 THEN '6-10 Transactions'
    WHEN total_tx BETWEEN 11 AND 20 THEN '11-20 Transactions'
    ELSE '20+ Transactions'
    END AS transaction_bucket,
    COUNT(*) AS depositor_count
    FROM tx_counts
    GROUP BY 1
    ORDER BY 2 DESC;



    QueryRunArchived: QueryRun has been archived