diff --git a/harnesses/chain-kpis/cmd/script/defillama.go b/harnesses/chain-kpis/cmd/script/defillama.go index c3ee658a..e221aa9d 100644 --- a/harnesses/chain-kpis/cmd/script/defillama.go +++ b/harnesses/chain-kpis/cmd/script/defillama.go @@ -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() diff --git a/harnesses/chain-kpis/cmd/script/registry.go b/harnesses/chain-kpis/cmd/script/registry.go index b68a25eb..cb2aca55 100644 --- a/harnesses/chain-kpis/cmd/script/registry.go +++ b/harnesses/chain-kpis/cmd/script/registry.go @@ -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"}, }