Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion harnesses/chain-kpis/cmd/script/defillama.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ func fetchDefillamaChain(c Chain) {
anyOK := false

if tvl, err := defillamaTvl(c.DefiLlama); err == nil {
chainTvlUsd.WithLabelValues(c.Slug).Set(tvl)
// Skip zero: DefiLlama serves the whole historical series as
// zero for chains where the relay layer holds no DeFi (Polkadot
// today), so we would render a "$0" card that reads as broken
// rather than as "no data". Card hides when the gauge stays
// unpublished. Non-zero values, including small ones, publish.
if tvl > 0 {
chainTvlUsd.WithLabelValues(c.Slug).Set(tvl)
}
anyOK = true
} else {
chainKpisFetchErrors.WithLabelValues(c.Slug, "defillama", classifyError(err.Error())).Inc()
Expand Down
8 changes: 8 additions & 0 deletions harnesses/chain-kpis/cmd/script/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,12 @@ var Registry = []Chain{
// stablecoin (~$1), the wrong asset for a native-token card.
{Slug: "fraxtal", DefiLlama: "Fraxtal", Mobula: "", NativeSymbol: "FRXETH"},
{Slug: "soneium", DefiLlama: "Soneium", Mobula: "", NativeSymbol: "ETH"},
// Polkadot relay chain. DefiLlama tracks the chain name but reports
// zero TVL and 500s on the DEX endpoint: relay chain has no DeFi and
// parachain DeFi (Acala, Moonbeam, Hydration) lives under those slugs.
// Stables endpoint returns real values via Asset Hub USDC/USDT
// issuance. DOT native price and mcap flow through Mobula. The zero
// TVL guard in defillama.go drops the empty TVL card so only real
// cards render.
{Slug: "polkadot", DefiLlama: "Polkadot", Mobula: "", NativeSymbol: "DOT"},
}
Loading