0xasmrUntitled Query
    Updated 2022-08-23
    WITH c AS(
    SELECT
    date_trunc(hour, block_timestamp),
    tx_hash,
    amount_deposited*price AS weth_deposited_usd
    FROM ethereum.maker.ez_deposits a
    JOIN ethereum.core.fact_hourly_token_prices b
    ON a.block_timestamp = b.hour
    WHERE a.symbol = 'WETH'
    AND b.symbol = 'WETH'
    )

    SELECT
    d.tx_hash,
    (d.amount_usd/c.weth_deposited_usd)*100 AS dai_borrowed_as_percentage_of_weth_deposited
    FROM ethereum.core.ez_token_transfers d
    JOIN c
    ON c.tx_hash = d.tx_hash
    WHERE d.contract_address = LOWER('0x6B175474E89094C44Da98b954EedeAC495271d0F')
    AND d.origin_function_signature = LOWER('0x1cff79cd')
    AND d.from_address = '0x0000000000000000000000000000000000000000'

    Run a query to Download Data