theericstoneHolders copy
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
›
⌄
-- forked from rmas / Holders @ https://flipsidecrypto.xyz/rmas/q/mbvXqhEWmE1r/holders
WITH
token_labels AS (
SELECT symbol
, token AS token_name
, token_contract
, decimals
FROM near.core.dim_token_labels
QUALIFY row_number() OVER (partition by token_contract order by symbol, token_name) = 1
),
rainbow_bridge_token_events AS (
WITH
mints AS (
SELECT fc.tx_hash
, fc.block_timestamp
, fc.method_name
, 'system' AS sender_id
, fc.args['account_id']::string AS receiver_id
, try_cast(fc.args['amount']::string as bigint) / power(10, tl.decimals) AS amount
, fc.receiver_id AS token_contract
, tl.symbol
FROM token_labels AS tl
INNER JOIN near.core.fact_actions_events_function_call AS fc
ON fc.receiver_id = tl.token_contract
WHERE tl.token_contract = '{{ TokenContract }}'
AND fc.receiver_id = '{{ TokenContract }}'
AND fc.method_name = 'mint'
-- Exclude failed TXs
Run a query to Download Data