Instability Index
-
{{ "%.1f"|format(instability.instability_index|default(0)) }}
+
{{ "%.1f"|format(instability.instability_index or 0) }}
{{ instability.risk_level|default('Unknown') }}
diff --git a/src/world_intel_mcp/reports/templates/market_overview.html b/src/world_intel_mcp/reports/templates/market_overview.html
index ee6814d..61cfc47 100644
--- a/src/world_intel_mcp/reports/templates/market_overview.html
+++ b/src/world_intel_mcp/reports/templates/market_overview.html
@@ -74,7 +74,7 @@
Sector Heatmap
{% for s in sector_heatmap %}
- {% set pct = s.change_pct|default(0) %}
+ {% set pct = s.change_pct if s.change_pct is not none else 0 %}
{% if pct >= 2 %}
{% set bg = '#166534' %}
{% elif pct >= 0.5 %}
@@ -113,12 +113,12 @@
{% for c in crypto[:15] %}
| {{ c.symbol|default(c.id|default(''))|upper }}{% if c.name %} {{ c.name }}{% endif %} |
- {{ "${:,.2f}".format(c.current_price|default(c.price|default(0))) }} |
-
- {{ "%+.2f"|format(c.price_change_percentage_24h|default(c.change_24h|default(0))) }}%
+ | {{ "${:,.2f}".format(c.current_price or c.price or 0) }} |
+
+ {{ "%+.2f"|format(c.price_change_percentage_24h or c.change_24h or 0) }}%
|
- {% set mcap = c.market_cap|default(0) %}
+ {% set mcap = c.market_cap or 0 %}
{% if mcap >= 1e12 %}${{ "%.1f"|format(mcap / 1e12) }}T
{% elif mcap >= 1e9 %}${{ "%.1f"|format(mcap / 1e9) }}B
{% elif mcap >= 1e6 %}${{ "%.1f"|format(mcap / 1e6) }}M
@@ -126,7 +126,7 @@
{% else %}—{% endif %}
|
- {% set vol = c.total_volume|default(c.volume_24h|default(0)) %}
+ {% set vol = c.total_volume or c.volume_24h or 0 %}
{% if vol >= 1e9 %}${{ "%.1f"|format(vol / 1e9) }}B
{% elif vol >= 1e6 %}${{ "%.1f"|format(vol / 1e6) }}M
{% elif vol > 0 %}${{ "{:,.0f}".format(vol) }}
@@ -186,8 +186,8 @@
|
| {{ name }} |
{% if data is mapping %}
-
- {% set flow = data.flow|default(data.net_flow|default(0)) %}
+ |
+ {% set flow = data.flow or data.net_flow or 0 %}
{% if flow >= 1e9 %}${{ "%+.1f"|format(flow / 1e9) }}B
{% elif flow >= 1e6 %}${{ "%+.1f"|format(flow / 1e6) }}M
{% else %}{{ "%+.2f"|format(flow) }}{% endif %}
|