diff --git a/apps/insights/src/components/Explanations/index.tsx b/apps/insights/src/components/Explanations/index.tsx index 787bfee5e0..0d75f600dd 100644 --- a/apps/insights/src/components/Explanations/index.tsx +++ b/apps/insights/src/components/Explanations/index.tsx @@ -4,6 +4,24 @@ import { useMemo } from "react"; import { Explain } from "../Explain"; import { FormattedDate } from "../FormattedDate"; +export const ExplainPermissioned = ({ + scoreTime, +}: { + scoreTime?: Date | undefined; +}) => { + return ( + +

+ This is the number of Price Feeds that a Publisher has + permissions to publish to. The publisher is not necessarily push data + for all the feeds they have access to, and some feeds may not be live + yet. +

+ {scoreTime && } +
+ ); +}; + export const ExplainAverage = ({ scoreTime, }: { diff --git a/apps/insights/src/components/Publishers/index.tsx b/apps/insights/src/components/Publishers/index.tsx index cd650359f1..f08c69ff86 100644 --- a/apps/insights/src/components/Publishers/index.tsx +++ b/apps/insights/src/components/Publishers/index.tsx @@ -147,6 +147,7 @@ export const Publishers = async () => { const toTableRow = ({ key, rank, + permissionedFeeds, inactiveFeeds, activeFeeds, averageScore, @@ -155,8 +156,9 @@ const toTableRow = ({ return { id: key, ranking: rank, - activeFeeds: activeFeeds, - inactiveFeeds: inactiveFeeds, + permissionedFeeds, + activeFeeds, + inactiveFeeds, averageScore, ...(knownPublisher && { name: knownPublisher.name, diff --git a/apps/insights/src/components/Publishers/publishers-card.tsx b/apps/insights/src/components/Publishers/publishers-card.tsx index 56918ac736..33f3a1f2b3 100644 --- a/apps/insights/src/components/Publishers/publishers-card.tsx +++ b/apps/insights/src/components/Publishers/publishers-card.tsx @@ -24,7 +24,11 @@ import styles from "./publishers-card.module.scss"; import { useQueryParamFilterPagination } from "../../hooks/use-query-param-filter-pagination"; import { CLUSTER_NAMES } from "../../services/pyth"; import { EntityList } from "../EntityList"; -import { ExplainActive, ExplainInactive } from "../Explanations"; +import { + ExplainPermissioned, + ExplainActive, + ExplainInactive, +} from "../Explanations"; import { NoResults } from "../NoResults"; import { PublisherTag } from "../PublisherTag"; import { Ranking } from "../Ranking"; @@ -43,6 +47,7 @@ type Props = { type Publisher = { id: string; ranking: number; + permissionedFeeds: number; activeFeeds: number; inactiveFeeds: number; averageScore: number; @@ -99,6 +104,7 @@ const ResolvedPublishersCard = ({ (a, b, { column, direction }) => { switch (column) { case "ranking": + case "permissionedFeeds": case "activeFeeds": case "inactiveFeeds": case "averageScore": { @@ -131,6 +137,7 @@ const ResolvedPublishersCard = ({ id, ranking, averageScore, + permissionedFeeds, activeFeeds, inactiveFeeds, ...publisher @@ -149,6 +156,7 @@ const ResolvedPublishersCard = ({ })} /> ), + permissionedFeeds, activeFeeds: ( & cluster: (typeof CLUSTER_NAMES)[number]; onChangeCluster: (value: (typeof CLUSTER_NAMES)[number]) => void; rows: (RowConfig< - "ranking" | "name" | "activeFeeds" | "inactiveFeeds" | "averageScore" + | "ranking" + | "name" + | "permissionedFeeds" + | "activeFeeds" + | "inactiveFeeds" + | "averageScore" > & { textValue: string })[]; } ); @@ -299,6 +312,7 @@ const PublishersCardContents = ({ headerLoadingSkeleton={} fields={[ { id: "averageScore", name: "Average Score" }, + { id: "permissionedFeeds", name: "Permissioned Feeds" }, { id: "activeFeeds", name: "Active Feeds" }, { id: "inactiveFeeds", name: "Inactive Feeds" }, ]} @@ -339,11 +353,23 @@ const PublishersCardContents = ({ loadingSkeleton: , allowsSorting: true, }, + { + id: "permissionedFeeds", + name: ( + <> + FEEDS + + + ), + alignment: "center", + width: 30, + allowsSorting: true, + }, { id: "activeFeeds", name: ( <> - ACTIVE FEEDS + ACTIVE ), @@ -355,7 +381,7 @@ const PublishersCardContents = ({ id: "inactiveFeeds", name: ( <> - INACTIVE FEEDS + INACTIVE ), diff --git a/apps/insights/src/services/clickhouse.ts b/apps/insights/src/services/clickhouse.ts index c6796a4cc8..9374a78306 100644 --- a/apps/insights/src/services/clickhouse.ts +++ b/apps/insights/src/services/clickhouse.ts @@ -15,6 +15,9 @@ export const getPublishers = async (cluster: Cluster) => z.strictObject({ key: z.string(), rank: z.number(), + permissionedFeeds: z + .string() + .transform((value) => Number.parseInt(value, 10)), activeFeeds: z .string() .transform((value) => Number.parseInt(value, 10)), @@ -50,6 +53,7 @@ export const getPublishers = async (cluster: Cluster) => timestamp, publisher AS key, rank, + LENGTH(symbols) AS permissionedFeeds, activeFeeds, inactiveFeeds, score_data.averageScore,