EkuboNumber of LPers
Updated 2023-11-10
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
›
⌄
WITH
deposit_hashs AS (
SELECT
TX_HASH AS hashes
FROM external.tokenflow_starknet.decoded_events ev
WHERE ev.CHAIN_ID = 'mainnet'
--AND ev.TX_HASH = '0x0795b952aafcc1a172165ca5e316f8ccf6872ab5c326c07876e877f2c23f6456'
AND ev.NAME = 'Deposit'
AND ev.CONTRACT = '0x02e0af29598b407c8716b17f6d2795eca1b471413fa03fb145a5e33722184067' --EkuboDeposits
)
, first_time_deposits AS (
SELECT
CONTRACT AS depositerAddress
, MIN(TIMESTAMP) AS firstDepositedDate
FROM external.tokenflow_starknet.decoded_transactions
WHERE CHAIN_ID = 'mainnet'
AND TX_HASH IN (SELECT hashes FROM deposit_hashs)
GROUP BY 1)
SELECT * FROM (
SELECT
DATE_TRUNC('{{Time_Frame}}', firstDepositedDate) AS "Date"
, COUNT(DISTINCT(depositerAddress)) AS "# New LPers"
, SUM(COUNT(DISTINCT(depositerAddress))) OVER(ORDER BY DATE_TRUNC('{{Time_Frame}}', firstDepositedDate) ) "Total # LPers"
FROM first_time_deposits
GROUP BY 1)
WHERE "Date" >= '2023-09-11'
Run a query to Download Data