0-MIDAverage Loan Held Time By Asset on Arbitrum Chain (DAY)
Updated 2023-03-02
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 act1 as (
with tab1 as (
select min(BLOCK_TIMESTAMP::date) as first_borrow
,CONTRACT_ADDRESS
,ORIGIN_FROM_ADDRESS
from arbitrum.core.fact_token_transfers
where ORIGIN_FUNCTION_SIGNATURE ='0xd5eed868'
and ORIGIN_TO_ADDRESS='0x794a61358d6845594f94dc1db02a252b5b4814ad'
and ORIGIN_FROM_ADDRESS=TO_ADDRESS
and FROM_ADDRESS<>'0x0000000000000000000000000000000000000000'
group by 2,3
),
tab2 as (
select ADDRESS
,DECIMALS
,SYMBOL
from arbitrum.core.dim_contracts)
select SYMBOL,first_borrow,ORIGIN_FROM_ADDRESS
from tab1
left join tab2
on tab1.CONTRACT_ADDRESS=tab2.ADDRESS),
act2 as (
with tab1 as (
select min(BLOCK_TIMESTAMP::date) as first_repay
,CONTRACT_ADDRESS
,ORIGIN_FROM_ADDRESS
from arbitrum.core.fact_token_transfers
where ORIGIN_FUNCTION_SIGNATURE in ('0x563dd613')
and ORIGIN_TO_ADDRESS='0x794a61358d6845594f94dc1db02a252b5b4814ad'
and ORIGIN_FROM_ADDRESS=FROM_ADDRESS
and TO_ADDRESS<>'0x0000000000000000000000000000000000000000'
group by 2,3
),
tab2 as (
select ADDRESS
,DECIMALS
Run a query to Download Data