MONTH | BLOCKCHAIN | BORROWS_CUMULATIVE | REPAYMENTS_CUMULATIVE | NET_BORROWS | |
---|---|---|---|---|---|
1 | 2021-09-01 00:00:00.000 | arbitrum | 44851444.59 | 31896813.53 | 12954631.06 |
2 | 2021-10-01 00:00:00.000 | arbitrum | 69113943.23 | 63272093.07 | 5841850.15999999 |
3 | 2021-11-01 00:00:00.000 | arbitrum | 88391286.92 | 79836326.68 | 8554960.23999998 |
4 | 2021-12-01 00:00:00.000 | arbitrum | 95581056.44 | 87216757.94 | 8364298.49999997 |
5 | 2022-01-01 00:00:00.000 | arbitrum | 104639730.22 | 98828367.04 | 5811363.17999998 |
6 | 2022-02-01 00:00:00.000 | arbitrum | 134511369.96 | 128490775.19 | 6020594.76999998 |
7 | 2022-03-01 00:00:00.000 | arbitrum | 155773118.28 | 148745168.17 | 7027950.10999998 |
8 | 2022-03-01 00:00:00.000 | optimism | 260177.41 | 124300.75 | 135876.66 |
9 | 2022-04-01 00:00:00.000 | arbitrum | 172429861.63 | 162883113.39 | 9546748.23999998 |
10 | 2022-04-01 00:00:00.000 | optimism | 1090711.27 | 669553.4 | 421157.87 |
11 | 2022-05-01 00:00:00.000 | arbitrum | 194951923.75 | 188497550.29 | 6454373.45999998 |
12 | 2022-05-01 00:00:00.000 | optimism | 3972582.71 | 2862499.47 | 1110083.24 |
13 | 2022-06-01 00:00:00.000 | arbitrum | 206109361.4 | 198124978.32 | 7984383.07999998 |
14 | 2022-06-01 00:00:00.000 | optimism | 13087688.38 | 10640212.61 | 2447475.77 |
15 | 2022-07-01 00:00:00.000 | arbitrum | 478624051.43 | 426253871.77 | 52370179.66 |
16 | 2022-07-01 00:00:00.000 | optimism | 20738784.35 | 17939687.84 | 2799096.50999999 |
17 | 2022-08-01 00:00:00.000 | arbitrum | 756276749.04 | 685511246.81 | 70765502.23 |
18 | 2022-08-01 00:00:00.000 | optimism | 1013692974.23 | 686043180.65 | 327649793.58 |
19 | 2022-09-01 00:00:00.000 | arbitrum | 856959953.31 | 821170977.06 | 35788976.25 |
20 | 2022-09-01 00:00:00.000 | optimism | 1356538357.44 | 1060567758.23 | 295970599.21 |
matejchiNet flows borrows
Updated 2025-04-12Copy Reference Fork
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 borrows as
(
select
date_trunc('month', block_timestamp) as month,
blockchain,
sum(amount_usd) as borrows_monthly,
sum(borrows_monthly) over (partition by blockchain order by month asc) as borrows_cumulative
from crosschain.defi.ez_lending_borrows
where
blockchain in ('base', 'arbitrum', 'optimism')
and month < date_trunc('month', current_date)
group by month, blockchain
),
repayments as
(
select
date_trunc('month', block_timestamp) as month,
blockchain,
sum(amount_usd) as repayments_monthly,
sum(repayments_monthly) over (partition by blockchain order by month asc) as repayments_cumulative
from crosschain.defi.ez_lending_repayments
where
blockchain in ('base', 'arbitrum', 'optimism')
and month < date_trunc('month', current_date)
group by month, blockchain
)
select
b.month,
b.blockchain,
b.borrows_cumulative,
r.repayments_cumulative,
b.borrows_cumulative - r.repayments_cumulative as net_borrows
from borrows b
join repayments r
on b.month = r.month
and b.blockchain = r.blockchain
Last run: 3 months ago
100
8KB
4s