Add market evidence notes to explorer surfaces
All checks were successful
phoenix-deploy Deployed to explorer-live
Deploy Explorer Live / deploy (push) Successful in 3m6s

This commit is contained in:
defiQUG
2026-04-30 03:53:13 -07:00
parent 8cd8bfa195
commit e397245ec9
6 changed files with 67 additions and 3 deletions

View File

@@ -0,0 +1,37 @@
import { formatRelativeAge, formatTimestamp } from '@/utils/format'
function formatSource(source?: string | null): string {
switch (source) {
case 'token-aggregation':
return 'token aggregation API'
case 'blockscout':
return 'Blockscout index'
case 'derived':
return 'derived from indexed supply and price inputs'
case 'mission-control':
return 'mission-control liquidity inventory'
default:
return source || 'source unavailable'
}
}
export default function MarketEvidenceNote({
source = 'token-aggregation',
lastUpdated,
method = 'DEX route and pool aggregation; visible liquidity only where indexed.',
compact = false,
}: {
source?: string | null
lastUpdated?: string | null
method?: string
compact?: boolean
}) {
const freshness = lastUpdated ? `${formatRelativeAge(lastUpdated)} (${formatTimestamp(lastUpdated)})` : 'timestamp unavailable'
const text = `Source: ${formatSource(source)}. Updated: ${freshness}. Method: ${method}`
return (
<p className={`${compact ? 'mt-1' : 'mt-3'} text-xs leading-5 text-gray-500 dark:text-gray-400`}>
{text}
</p>
)
}