Skip to content

chain-kpis: add polkadot (DOT native, Asset Hub stables)#1191

Merged
Flotapponnier merged 1 commit into
devfrom
feat/polkadot-live-kpis
Jul 16, 2026
Merged

chain-kpis: add polkadot (DOT native, Asset Hub stables)#1191
Flotapponnier merged 1 commit into
devfrom
feat/polkadot-live-kpis

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Summary

Adds Polkadot to the chain-kpis harness registry so /chains/polkadot renders a live KPI strip like every other chain page. Also guards the DefiLlama TVL publish to skip zero values.

Behavior

Cards that render on /chains/polkadot after this ships:

  • Stablecoins ~$64.5M (Asset Hub USDC + USDT, via DefiLlama stablecoincharts/Polkadot)
  • DOT price (Mobula market/data?symbol=DOT)
  • DOT market cap (Mobula, live 2s refresh)

Cards intentionally hidden:

  • TVL: DefiLlama serves an all zero history for the Polkadot relay chain (every DeFi protocol on Polkadot lives under a parachain slug: Acala, Moonbeam, Hydration). The new if tvl > 0 guard in defillama.go keeps the gauge unpublished so the card hides instead of rendering "$0".
  • DEX 24h: DefiLlama /overview/dexs/Polkadot returns 500, gauge stays unpublished on error, card hides.
  • TVL history chart: not adding polkadot to DEFILLAMA_CHAIN_NAME in src/lib/chain-kpis.ts for the same zero series reason; chart hides gracefully.

Files

  • harnesses/chain-kpis/cmd/script/registry.go: append polkadot entry
  • harnesses/chain-kpis/cmd/script/defillama.go: guard TVL publish on > 0

The TVL guard is a general QoL fix. Any chain that DefiLlama tracks by name but with a legitimately zero TVL series will now hide the card instead of surfacing a broken looking "$0".

Test plan

  • Harness go build ./... passes
  • Deploy harness, verify chain_native_price_usd{chain="polkadot", symbol="DOT"} and chain_native_mcap_usd{chain="polkadot"} publish
  • Verify chain_stables_mcap_usd{chain="polkadot"} publishes with the Asset Hub aggregate
  • Verify chain_tvl_usd{chain="polkadot"} stays absent (zero guard)
  • Preview URL: /chains/polkadot renders 3 cards (Stables, DOT price, DOT mcap)

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.
@Flotapponnier
Flotapponnier merged commit c65d1c7 into dev Jul 16, 2026
1 check failed
@Flotapponnier
Flotapponnier deleted the feat/polkadot-live-kpis branch July 16, 2026 10:24
Flotapponnier added a commit that referenced this pull request Jul 16, 2026
…ub) (#1191) (#1192)

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.

Co-authored-by: Florent Tapponnier <contact@mobula.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant