binhachonCurve - Yearn: number of yveCRV holders that claim reward per month
Updated 2021-09-24
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
›
⌄
SELECT
CASE
WHEN Number_of_claim = 0 THEN '0 claim'
WHEN Number_of_claim = 1 THEN '1 claim'
WHEN Number_of_claim = 2 THEN '2 claims'
WHEN Number_of_claim = 3 THEN '3 claims'
ELSE 'More than 3 claims' END as Group_by_claim,
COUNT(FROM_ADDRESS),
BLOCKTIME
FROM(
SELECT COUNT(FROM_ADDRESS) as Number_of_claim, FROM_ADDRESS, DATE_TRUNC('month',BLOCKTIME) as BLOCKTIME FROM(
SELECT ethereum.transactions.FROM_ADDRESS, FEE_USD AS FEE, AMOUNT, ethereum.transactions.TX_ID, ethereum.transactions.BLOCK_TIMESTAMP AS BLOCKTIME FROM ethereum.transactions, ethereum.udm_events
WHERE ethereum.transactions.TO_ADDRESS = '0xc5bddf9843308380375a611c18b50fb9341f502a'
AND ethereum.transactions.FUNCTION_SIGNATURE = '0x4e71d92d'
AND AMOUNT > 0
AND ethereum.transactions.TX_ID = ethereum.udm_events.TX_ID
)
GROUP BY 2,3
)
GROUP BY 1,3
ORDER BY 3,2 DESC
-- SELECT * FROM ethereum.udm_events
-- WHERE TX_ID = '0x22709fc99aba2a2ed559d84e5e29ea066ed2308af282ab02df1276570145a316'
Run a query to Download Data