0xHaM-dTop 10 ETH BORROWERs by Volume
    Updated 2022-09-06
    with all_tx as (
    SELECT
    BLOCK_TIMESTAMP,
    'BORROWER' as status,
    TX_HASH,
    BORROWER as users,
    AMOUNT_LOANED as amount
    FROM ethereum.maker.ez_flash_loans
    WHERE TX_STATUS = 'SUCCESS'
    and symbol = 'WETH'
    )
    SELECT
    users,
    COUNT(DISTINCT TX_HASH) as tx_cnt,
    sum(amount) as total_amt
    from all_tx
    WHERE BLOCK_TIMESTAMP::date >= '{{since_date}}'
    group by 1
    order by 3 DESC
    limit 10



    Run a query to Download Data