0xHaM-dEcho Protocol Over Time Final
Updated 2024-12-06Copy 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 echoRepayEventTb as (
SELECT
BLOCK_TIMESTAMP,
TX_HASH,
SENDER as user,
PAYLOAD,
split(split(PAYLOAD:function, '::')[2], '_')[0] as function,
PAYLOAD:arguments[1]/1e6 as amt,
split(PAYLOAD:type_arguments[0], '::')[2]::string as asset,
PAYLOAD:type_arguments[0]::string as TOKEN_ADDRESS,
FROM aptos.core.fact_transactions
WHERE PAYLOAD_FUNCTION ilike '%0xeab7ea4d635b6b6add79d5045c4a45d8148d88287b1cfa1c3b6a4b56f46839ed%'
AND SUCCESS = TRUE
AND PAYLOAD_FUNCTION ilike ('%repay_simple')
AND asset::string ilike ANY ('%USDT%', '%USDC%')
)
,
echoBorrowEventTb as (
SELECT
BLOCK_TIMESTAMP,
TX_HASH,
SENDER as user,
PAYLOAD,
split(split(PAYLOAD:function, '::')[2], '_')[0] as function,
PAYLOAD:arguments[2]/1e6 as amt,
split(PAYLOAD:type_arguments[0], '::')[2]::string as asset,
PAYLOAD:type_arguments[0]::string as TOKEN_ADDRESS,
FROM aptos.core.fact_transactions
WHERE PAYLOAD_FUNCTION ilike '%0xeab7ea4d635b6b6add79d5045c4a45d8148d88287b1cfa1c3b6a4b56f46839ed%'
AND SUCCESS = TRUE
-- AND function in ('borrow')
AND PAYLOAD_FUNCTION ilike ('%borrow_simple')
AND asset::string ilike ANY ('%USDT%', '%USDC%')
)
,
echoBorrowEvent as (
QueryRunArchived: QueryRun has been archived