mb1124Amount of DAI borrowed
    Updated 2022-08-25
    WITH wethDeposits AS (
    SELECT tx_hash, block_timestamp, depositor,
    amount_deposited as weth_deposited
    FROM ethereum.maker.ez_deposits
    WHERE
    token_deposited='0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' AND
    tx_hash IN (SELECT tx_hash FROM ethereum.maker.ez_vault_creation)
    )

    , borrowed AS( SELECT tx_hash, amount AS daiBorrowed
    FROM ethereum.core.ez_token_transfers
    WHERE tx_hash IN (SELECT tx_hash FROM wethDeposits)
    AND contract_address='0x6b175474e89094c44da98b954eedeac495271d0f'
    AND from_address='0x0000000000000000000000000000000000000000'
    )

    SELECT block_timestamp,
    depositor,
    daiBorrowed
    FROM wethDeposits wd INNER JOIN Borrowed b ON wd.tx_hash=b.tx_hash
    Run a query to Download Data