samspecific-gold
    Updated 2025-03-11

    -- select sum(amount)
    -- from
    -- (
    -- select sum(AMOUNT) as amount
    -- from arbitrum.defi.ez_lending_borrows
    -- where CONTRACT_ADDRESS = '0x9c4ec768c28520b50860ea7a15bd7213a9ff58bf'
    -- and TOKEN_ADDRESS = '0xaf88d065e77c8cc2239327c5edb3a432268e5831'
    -- union all
    -- select -sum(AMOUNT)
    -- from arbitrum.defi.ez_lending_repayments
    -- where CONTRACT_ADDRESS = '0x9c4ec768c28520b50860ea7a15bd7213a9ff58bf'
    -- and TOKEN_ADDRESS = '0xaf88d065e77c8cc2239327c5edb3a432268e5831'
    -- )

    select sum(amount)
    from arbitrum.defi.ez_lending_repayments
    where 1 = 1 --CONTRACT_ADDRESS = '0x9c4ec768c28520b50860ea7a15bd7213a9ff58bf'
    and TOKEN_ADDRESS = '0xaf88d065e77c8cc2239327c5edb3a432268e5831'
    and protocol_market = '0x9c4ec768c28520b50860ea7a15bd7213a9ff58bf'
    limit 10
    Last run: about 1 month ago
    SUM(AMOUNT)
    1
    974155652.142504
    1
    20B
    2s