hypergladelender over time copy
Updated 2024-06-27
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
›
⌄
-- forked from sam / lender over time @ https://flipsidecrypto.xyz/sam/q/I0W6zaaA4OPk/lender-over-time
with deposits_base as (
select
block_timestamp,
tx_hash,
from_address as lender,
amount
from ethereum.core.ez_token_transfers
where block_timestamp >= '2021-01-01'
and origin_function_signature = '0x515bc323'
and contract_address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' -- usdc
and to_address = '{{borrower_pool}}' -- variable
)
select
date_trunc('month', block_timestamp) as monthly,
count(distinct lender) as lenders,
sum(lenders) over (order by monthly asc) as lenders_total,
sum(amount) as user_deposits,
sum(user_deposits) over (order by monthly asc) as deposits_total
from deposits_base
group by monthly
QueryRunArchived: QueryRun has been archived