Updated 2024-09-22
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
›
⌄
with tbl AS
(
SELECT
tx_hash,
'0x'|| SUBSTR(data, 27, 40) as address,
utils.udf_hex_to_int(SUBSTR(data, 67, 64)) /POW(10, 18) AS amount
FROM
berachain.testnet.fact_event_logs
where contract_address = lower ('0x1306D3c36eC7E38dd2c128fBe3097C2C2449af64')
and ORIGIN_FUNCTION_SIGNATURE = '0xa415bcad'--borrow
and origin_from_address != '0x0000000000000000000000000000000000000000'
AND
topics[0] = '0xb3d084820fb1a9decffb176436bd02558d15fac9b0ddfed8c465bc7359d7dce0'
)
SELECT sum (amount) AS "Total borrow",
count (DISTINCT tx_hash) as "Total borrow tx",
count (DISTINCT address) as "Total unique borrowers"
from tbl
QueryRunArchived: QueryRun has been archived