siwakon-ethload-dept-data
Updated 2024-10-15
999
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 daily_mints AS (
SELECT
date_trunc('day', block_timestamp) AS date,
SUM(debt_mint) AS total_debt_mint
FROM
(
SELECT
block_timestamp,
livequery.utils.udf_hex_to_int(
regexp_substr_all(SUBSTR(input, 11), '.{64}') [2] :: string
) / POW(10, 18) AS debt_mint
FROM
berachain.testnet.fact_traces
WHERE
from_address = '0x0bf0eb9ae016a624e2149d4c5f47fd9276285c82'
AND to_address = '0x1339503343be5626b40ee3aee12a4df50aa4c0b9'
AND LEFT(input, 10) = '0x27f100f4'
AND tx_succeeded = TRUE
) subquery
GROUP BY
date_trunc('day', block_timestamp)
),
daily_burns AS (
SELECT
date_trunc('day', block_timestamp) AS date,
SUM(debt_burn) AS total_debt_burn
FROM
(
SELECT
block_timestamp,
livequery.utils.udf_hex_to_int(
regexp_substr_all(SUBSTR(input, 11), '.{64}') [2] :: string
) :: bigint / POW(10, 18) AS debt_burn
FROM
berachain.testnet.fact_traces
WHERE
QueryRunArchived: QueryRun has been archived