princefarzamDeposit+withdraw+Reinvest Yield Yak: Benqi AVAX (YRT)
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
Deposit AS (
SELECT
date_trunc('day', block_timestamp)::date AS Day,
Count(DISTINCT TX_HASH) AS Number_of_deposits,
Count(DISTINCT ORIGIN_FROM_ADDRESS) AS Depositors,
Sum(DECODED_LOG:amount::int) / POW(10, 18) AS Amount_deposited,
Sum(Amount_deposited) over (
Order by
day
) AS Cum_amount_deposited
FROM
avalanche.core.ez_decoded_event_logs
WHERE
CONTRACT_ADDRESS = '0x8b414448de8b609e96bd63dcf2a8adbd5ddf7fdd' -- Yield Yak: Benqi AVAX (YRT)
AND ORIGIN_FUNCTION_SIGNATURE = '0xd0e30db0'
AND EVENT_NAME = 'Deposit'
AND TX_STATUS = 'SUCCESS'
GROUP BY
day
ORDER BY
day ASC
),
Reinvest AS (
SELECT
date_trunc('day', block_timestamp)::date AS Day,
Count(DISTINCT TX_HASH) AS Number_of_Reinvests,
Count(DISTINCT ORIGIN_FROM_ADDRESS) AS Number_of_Reinvesters,
Sum(DECODED_LOG:wad::int) / POW(10, 17) AS Amount_Reinvest,
Sum(Amount_Reinvest) over (
Order by
day
) AS Cum_Amount_Reinvest
FROM
avalanche.core.ez_decoded_event_logs
WHERE
Run a query to Download Data