{% from "_provenance_macros.html" import provenance_link %} {% set partial = kpis.missing_symbols and (kpis.open_position_value is not none) %} {% set period_label = kpis.period_label or 'Period' %}
{# --- Realized hero (combined YTD + Lifetime) --- #}
Realized P/L
{{ period_label }}
{% if kpis.period_realized < 0 %}−{% else %}+{% endif %}${{ "%.2f"|format(kpis.period_realized|float|abs) }}{% if metric_refs is defined and metric_refs.realized_period is defined %}{{ provenance_link(metric_refs.realized_period) }}{% endif %}
Lifetime
{% if kpis.lifetime_realized < 0 %}−{% else %}+{% endif %}${{ "%.2f"|format(kpis.lifetime_realized|float|abs) }}{% if metric_refs is defined and metric_refs.lifetime_realized is defined %}{{ provenance_link(metric_refs.lifetime_realized) }}{% endif %}
{# --- Unrealized hero (combined YTD + Lifetime) --- #}
Unrealized P/L
{{ period_label }}
{% if kpis.period_unrealized is none %} {% elif kpis.period_unrealized < 0 %} −${{ "%.2f"|format(kpis.period_unrealized|float|abs) }}{% if metric_refs is defined and metric_refs.period_unrealized is defined %}{{ provenance_link(metric_refs.period_unrealized) }}{% endif %} {% else %} +${{ "%.2f"|format(kpis.period_unrealized|float) }}{% if metric_refs is defined and metric_refs.period_unrealized is defined %}{{ provenance_link(metric_refs.period_unrealized) }}{% endif %} {% endif %}
Lifetime
{% if kpis.lifetime_unrealized is none %} {% elif kpis.lifetime_unrealized < 0 %} −${{ "%.2f"|format(kpis.lifetime_unrealized|float|abs) }}{% if metric_refs is defined and metric_refs.lifetime_unrealized is defined %}{{ provenance_link(metric_refs.lifetime_unrealized) }}{% endif %} {% else %} +${{ "%.2f"|format(kpis.lifetime_unrealized|float) }}{% if metric_refs is defined and metric_refs.lifetime_unrealized is defined %}{{ provenance_link(metric_refs.lifetime_unrealized) }}{% endif %} {% endif %}
{# --- Open Position $ (mini) --- #} {# Open Position $ is a market-price snapshot (qty × price), not a sum of trades — no provenance trace. #}
Open position $
{% if kpis.open_position_value is none %} {% else %} ${{ "%.2f"|format(kpis.open_position_value|float) }} {% endif %}
{% if kpis.missing_symbols %}{{ kpis.missing_symbols|length }} unpriced{% else %}all priced{% endif %}
{# --- Wash impact (mini) --- #}
Wash impact
{% if wash_impact_total is defined and wash_impact_total %} −${{ "%.2f"|format(wash_impact_total|float|abs) }}{% if metric_refs is defined and metric_refs.wash_impact_period is defined %}{{ provenance_link(metric_refs.wash_impact_period) }}{% endif %} {% else %} $0.00{% if metric_refs is defined and metric_refs.wash_impact_period is defined %}{{ provenance_link(metric_refs.wash_impact_period) }}{% endif %} {% endif %}
{% if wash_violations is defined and wash_violations %}{{ wash_violations }} violation{% if wash_violations != 1 %}s{% endif %}{% else %}no violations{% endif %}
{% if offset_budget is defined and offset_budget %} {% set budget = offset_budget %} {% include "_offset_budget_tile.html" with context %} {% endif %} {% include "_projection_card.html" with context %} {% if cash_kpis is defined %}
{# --- Cash --- #}
Cash
{% if cash_kpis.cash_balance < 0 %} −${{ "%.2f"|format(cash_kpis.cash_balance|float|abs) }} {% else %} ${{ "%.2f"|format(cash_kpis.cash_balance|float) }} {% endif %}{% if metric_refs is defined and metric_refs.cash is defined %}{{ provenance_link(metric_refs.cash) }}{% endif %}
{{ "%.0f"|format((cash_kpis.cash_share_pct|float) * 100) }}% of account
{# --- Net contributed --- #}
Net contributed
{% if cash_kpis.net_contributions < 0 %} −${{ "%.2f"|format(cash_kpis.net_contributions|float|abs) }} {% else %} ${{ "%.2f"|format(cash_kpis.net_contributions|float) }} {% endif %}{% if metric_refs is defined and metric_refs.net_contributed_period is defined %}{{ provenance_link(metric_refs.net_contributed_period) }}{% endif %}
deposits − withdrawals
{# --- Growth --- #}
Growth
{% if cash_kpis.growth < 0 %}−{% else %}+{% endif %}${{ "%.2f"|format(cash_kpis.growth|float|abs) }}
{% if cash_kpis.growth_pct is not none %} {% if cash_kpis.growth_pct < 0 %}−{% else %}+{% endif %}{{ "%.1f"|format((cash_kpis.growth_pct|float|abs) * 100) }}% vs contributed {% else %} no contributions {% endif %}
{% endif %} {% if snapshot is defined and snapshot.degraded %}
Showing stale prices (provider unavailable).
{% endif %} {% if kpis.missing_symbols %}
{% if kpis.open_position_value is none %} No quotes available. {% else %} Partial sum — {{ kpis.missing_symbols|length }} symbol{% if kpis.missing_symbols|length != 1 %}s{% endif %} unpriced: {{ kpis.missing_symbols|join(', ') }} {% endif %}
{% endif %}