StangFAST01 - sbt minter part 2
Updated 2023-07-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
28
29
30
31
32
33
34
35
36
›
⌄
-- forked from 02 - sbt holder @ https://flipsidecrypto.xyz/edit/queries/1b27f50d-2638-4caf-b504-da2c8b8cc47f
-- forked from 02 - sbt @ https://flipsidecrypto.xyz/edit/queries/aff3a4fe-2d08-482e-8781-8fed99aa1b6e
-- forked from 01 - sbt @ https://flipsidecrypto.xyz/edit/queries/ef7309d5-c577-47fe-9498-423f2b15256a
with
sbt_holder AS
(
SELECT
min( a.block_timestamp ) AS min_date
, a.signer_id AS user
FROM
near.core.fact_actions_events a
WHERE
a.receiver_id = 'registry.i-am-human.near'
AND a.action_data:method_name = 'sbt_mint'
GROUP BY 2
ORDER BY 1 DESC
)
SELECT
date_trunc( 'day' , a.block_timestamp ) AS date
, count( DISTINCT a.signer_id ) AS users
, a.action_data:method_name AS action
FROM
near.core.fact_actions_events a
JOIN
sbt_holder b
ON a.signer_id = b.user
WHERE
date < dateadd( 'day' , -1 , current_date )
AND a.action_data:method_name IS NOT NULL
AND a.action_data:method_name NOT LIKE '%callback%'
AND a.receiver_id IN
(
Run a query to Download Data