mrwildcatPyth Oracle on Gnosis, Top Contracts
Updated 2025-02-11
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 Pyth Oracle on Base, Top Contracts @ https://flipsidecrypto.xyz/edit/queries/94c89a33-82dc-4e44-a0b9-77239dd3e404
-- forked from Pyth Oracle on BSC, Top Contracts @ https://flipsidecrypto.xyz/edit/queries/c5bddb69-cd5a-48ad-84cd-0ddae8ee1ae2
WITH price_updates AS (
SELECT
from_address AS contract_address,
COUNT(*) AS update_count
FROM gnosis.core.fact_traces
WHERE to_address = LOWER('0x2880aB155794e7179c9eE2e38200202908C17B43')
AND block_timestamp >= CURRENT_TIMESTAMP - INTERVAL '6 months'
AND SUBSTRING(input, 1, 10) IN (
'0xef9e5e28', '0xb9256d28', '0x785bdda0', '0xf4347f83',
'0x4716e9c5', '0xaccca7f9', '0x0d4702e1', '0x631a316c'
)
AND type = 'CALL'
GROUP BY 1
),
user_counts AS (
SELECT
to_address AS contract_address,
COUNT(DISTINCT from_address) AS unique_users
FROM gnosis.core.fact_transactions
WHERE block_timestamp >= CURRENT_TIMESTAMP - INTERVAL '6 months'
AND status = 'SUCCESS'
AND to_address IN (
SELECT contract_address
FROM price_updates
)
GROUP BY 1
)
SELECT
pu.contract_address,
pu.update_count AS price_updates,
COALESCE(uc.unique_users, 0) AS number_of_users,
COALESCE(dl.PROJECT_NAME, 'Unknown') AS project_name
QueryRunArchived: QueryRun has been archived