kimkimtop 10 DAI borrowers from MakerDao
Updated 2022-08-24
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with weth_deposits as (
select
tx_hash,
block_timestamp,
depositor,
amount_deposited as weth_deposited
from ethereum.maker.ez_deposits
where tx_hash in (select tx_hash from ethereum.maker.ez_vault_creation)
and token_deposited = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -- weth
),
dai_borrows as (
select
tx_hash,
amount as dai_borrowed
from ethereum.core.ez_token_transfers
where tx_hash in (select tx_hash from weth_deposits)
and from_address = '0x0000000000000000000000000000000000000000'
and contract_address = '0x6b175474e89094c44da98b954eedeac495271d0f' -- dai
),
deposit_and_borrow as (
select
block_timestamp::date as day,
depositor,
weth_deposited,
dai_borrowed
from weth_deposits d
inner join dai_borrows b on d.tx_hash = b.tx_hash
),
weth_prices as (
select
hour::date as days,
avg(price) as weth_price
Run a query to Download Data