From f5b4a3ac9510bf04e5dc1b0429f9ba3df7ed33a5 Mon Sep 17 00:00:00 2001 From: Florent Tapponnier Date: Thu, 16 Jul 2026 12:21:39 +0200 Subject: [PATCH] chain-kpis: add polkadot to registry (DOT native, stables via Asset Hub) Ships live KPIs on /chains/polkadot. DOT price and mcap flow through Mobula. Stables card renders via DefiLlama Asset Hub aggregate. TVL and DEX gauges stay unpublished (relay chain has zero DeFi: parachain TVL lives under Acala, Moonbeam, Hydration). Also guards defillama TVL publish to skip zero values so chains that DefiLlama tracks by name but with an all zero series (Polkadot today) hide the TVL card instead of rendering $0. --- harnesses/chain-kpis/cmd/script/defillama.go | 9 ++++++++- harnesses/chain-kpis/cmd/script/registry.go | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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"}, }