Skip to content

Commit 0839943

Browse files
committed
added support, labeling, and filtering for stablecoin stability assessment on base
1 parent 75d4352 commit 0839943

File tree

4 files changed

+64
-11
lines changed

4 files changed

+64
-11
lines changed

src/features/data/api/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface DecodingVariable {
99

1010
export interface Docs {
1111
assetName?: string
12+
assetClass?: string
1213
feedCategory?: string
1314
feedType?: string
1415
hidden?: boolean
@@ -46,6 +47,7 @@ export interface ChainMetadata {
4647
secondaryProxyAddress?: string
4748
threshold: number
4849
valuePrefix: string
50+
valueSuffix?: string
4951
assetName: string
5052
feedCategory: string
5153
feedType: string
@@ -233,6 +235,7 @@ export const mergeWithMVRFeeds = async (
233235
"ethereum-testnet-sepolia-arbitrum-1": ["arbitrum-sepolia"],
234236
"ethereum-testnet-sepolia": ["ethereum-sepolia"],
235237
"avalanche-mainnet": ["avalanche-mainnet"],
238+
"ethereum-mainnet-base-1": ["base-mainnet"],
236239
"ethereum-testnet-sepolia-base-1": ["base-sepolia"],
237240
}
238241

@@ -292,11 +295,13 @@ export const mergeWithMVRFeeds = async (
292295
secondaryProxyAddress: contractAddress || undefined,
293296
threshold: feed.threshold || 0,
294297
valuePrefix: feed.valuePrefix || "",
298+
valueSuffix: feed.valueSuffix,
295299
assetName: feed.docs.assetName,
296300
feedCategory: feed.docs.feedCategory || "Custom",
297301
feedType: feed.docs.feedType || feed.docs.assetClass,
298302
docs: {
299303
assetName: feed.docs.assetName,
304+
assetClass: feed.docs.assetClass,
300305
feedCategory: feed.docs.feedCategory || "Custom",
301306
feedType: feed.docs.feedType || feed.docs.assetClass,
302307
productType: feed.docs.productType || "Proof of Reserve",

src/features/feeds/components/FeedList.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ div.shutDate > hr {
7070
display: inline-block;
7171
position: relative;
7272
cursor: pointer;
73-
width: 200px;
73+
width: 280px;
7474
}
7575

7676
.filterDropdown_search {

src/features/feeds/components/FeedList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ export const FeedList = ({
221221
{ key: "Proof of Reserve", name: "Proof of Reserve" },
222222
{ key: "NAVLink", name: "NAVLink" },
223223
{ key: "SmartAUM", name: "SmartAUM" },
224+
{ key: "Stablecoin Stability Assessment", name: "Stablecoin Stability Assessment" },
224225
]
225226
const [streamsChain] = useState(initialNetwork)
226227
const activeChain = isStreams ? streamsChain : currentNetwork

src/features/feeds/components/Tables.tsx

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,36 @@ import { ExpandableTableWrapper } from "./ExpandableTableWrapper.tsx"
1616

1717
const feedItems = monitoredFeeds.mainnet
1818

19+
// Helper function to parse markdown links and render them
20+
const parseMarkdownLink = (text: string) => {
21+
// Match markdown link format: [text](url)
22+
const markdownLinkRegex = /\[([^\]]+)\]\(([^)]+)\)/g
23+
const parts: any[] = []
24+
let lastIndex = 0
25+
let match
26+
27+
while ((match = markdownLinkRegex.exec(text)) !== null) {
28+
// Add text before the link
29+
if (match.index > lastIndex) {
30+
parts.push(text.substring(lastIndex, match.index))
31+
}
32+
// Add the link
33+
parts.push(
34+
<a href={match[2]} target="_blank" rel="noopener noreferrer" key={match.index}>
35+
{match[1]}
36+
</a>
37+
)
38+
lastIndex = match.index + match[0].length
39+
}
40+
41+
// Add remaining text after the last link
42+
if (lastIndex < text.length) {
43+
parts.push(text.substring(lastIndex))
44+
}
45+
46+
return parts.length > 0 ? parts : text
47+
}
48+
1949
// Render a category icon/link from the config
2050
const getFeedCategoryElement = (riskTier: string | undefined) => {
2151
if (!riskTier) return ""
@@ -421,13 +451,18 @@ const SmartDataTr = ({ network, metadata, showExtraDetails, batchedCategoryData
421451
{metadata.docs.shutdownDate}
422452
</div>
423453
)}
424-
{metadata.docs.productType && (
425-
<div>
426-
<dd style={{ marginTop: "5px" }}>{metadata.docs.productType}</dd>
454+
{(metadata.docs.assetClass === "Stablecoin Stability Assessment" ||
455+
(metadata.docs.productType && metadata.docs.assetClass !== "Stablecoin Stability Assessment")) && (
456+
<div style={{ marginTop: "5px", textAlign: "center" }}>
457+
<dd>
458+
{metadata.docs.assetClass === "Stablecoin Stability Assessment"
459+
? metadata.docs.assetClass
460+
: metadata.docs.productType}
461+
</dd>
427462
</div>
428463
)}
429464
{finalIsMVRFeed && (
430-
<div style={{ marginTop: "5px" }}>
465+
<div style={{ marginTop: "5px", textAlign: "center" }}>
431466
<a
432467
href="/data-feeds/mvr-feeds"
433468
className={tableStyles.feedVariantBadge}
@@ -478,11 +513,21 @@ const SmartDataTr = ({ network, metadata, showExtraDetails, batchedCategoryData
478513
<dl className={tableStyles.listContainer}>
479514
<div className={tableStyles.definitionGroup}>
480515
<dt>
481-
<span className="label">Asset name:</span>
516+
<span className="label">
517+
{metadata.docs.assetClass === "Stablecoin Stability Assessment"
518+
? "Stablecoin assessed:"
519+
: "Asset name:"}
520+
</span>
482521
</dt>
483-
<dd>{metadata.assetName}</dd>
522+
<dd>
523+
{/* For Stablecoin Stability Assessment feeds, valueSuffix contains the stablecoin ticker being assessed*/}
524+
{metadata.docs.assetClass === "Stablecoin Stability Assessment"
525+
? metadata.valueSuffix || metadata.assetName
526+
: metadata.assetName}
527+
</dd>
484528
</div>
485-
{metadata.docs.porType && (
529+
{/* Hide Reserve type for Stablecoin Stability Assessment feeds */}
530+
{metadata.docs.porType && metadata.docs.assetClass !== "Stablecoin Stability Assessment" && (
486531
<div className={tableStyles.definitionGroup}>
487532
<dt>
488533
<span className="label">Reserve type:</span>
@@ -505,7 +550,7 @@ const SmartDataTr = ({ network, metadata, showExtraDetails, batchedCategoryData
505550
{metadata.docs.porSource === "Third-party" ? "Auditor verification:" : "Reporting:"}
506551
</span>
507552
</dt>
508-
<dd>{metadata.docs.porSource}</dd>
553+
<dd>{parseMarkdownLink(metadata.docs.porSource)}</dd>
509554
</div>
510555
)}
511556
{metadata.docs.issuer ? (
@@ -1153,7 +1198,8 @@ export const MainnetTable = ({
11531198

11541199
const included =
11551200
selectedFeedCategories.length === 0 ||
1156-
(metadata.docs.productType && selectedFeedCategories.includes(metadata.docs.productType))
1201+
(metadata.docs.productType && selectedFeedCategories.includes(metadata.docs.productType)) ||
1202+
(metadata.docs.assetClass && selectedFeedCategories.includes(metadata.docs.assetClass))
11571203

11581204
return included
11591205
}
@@ -1412,7 +1458,8 @@ export const TestnetTable = ({
14121458

14131459
const included =
14141460
selectedFeedCategories.length === 0 ||
1415-
(metadata.docs.productType && selectedFeedCategories.includes(metadata.docs.productType))
1461+
(metadata.docs.productType && selectedFeedCategories.includes(metadata.docs.productType)) ||
1462+
(metadata.docs.assetClass && selectedFeedCategories.includes(metadata.docs.assetClass))
14161463

14171464
return included
14181465
}

0 commit comments

Comments
 (0)