Asteria Investment Office
Work with the shared Asteria Investment Office environment to produce
portfolio-risk and allocation outputs. Every task provides an answer template
JSON — conform to its exact structure, key ordering, allowed values, and
precision.
Core Principle: API Over Local Payloads
Local task payloads (desk_request, review_request, risk_meeting_memo, etc.)
are intake context only. They may carry stale marks, worksheet snapshots, or
preferences from earlier dates. The current environment API is the book of
record. When values differ, prefer the API and set the data_precedence field
to current_environment_over_stale_payload when the template includes it.
Environment Setup
Read the environment_access.md file provided with each task for the base URL.
All endpoints are GET with no authentication. Start every task by reading the
API landing page (GET /) for endpoint discovery.
API reference: references/api.md. Load it when endpoint
details or field schemas are needed beyond what the task payload describes.
Scripts
Correlation Computation
scripts/correlation.py — Computes Pearson correlation
of monthly simple returns from two index-level series.
Usage: pipe a JSON object with levels_a and levels_b (each an array of
{date, level} objects) to stdin. Outputs {correlation, return_observations}.
Use this script for all pairwise index correlations. Do not implement correlation
manually. The script guarantees 3-decimal rounding consistent with the policy
thresholds.
Portfolio Weighted-Average Metrics
scripts/weighted_metrics.py — Computes
post-trade / post-rotation portfolio metrics from enriched holding-level data.
Usage: pipe a JSON object with holdings (array of {quantity_usd_m, instrument}
where instrument is the full bond object from /api/instruments/bonds) to
stdin. Outputs total_market_value_usd_m, hy_allocation_pct,
weighted_modified_duration_years, weighted_yield_to_maturity_pct. All
values rounded to 2 decimal places.
Build the input by merging current portfolio holdings with proposed trades
(adding BUY quantities, removing SELL quantities) and attaching the full bond
record to each holding.
Workflows
Energy Credit Trade Strategy
When the prompt requests a trade package for an energy credit portfolio:
- Read the answer template for required structure, precision, and allowed values.
- Fetch
/api/portfolios/{portfolio_id}/holdings for current positions.
- Fetch
/api/instruments/bonds for the full bond universe.
- Fetch
/api/issuers for watchlist status and credit outlook.
- Fetch
/api/policies for the portfolio's constraint policy (match via
the portfolio's constraint_policy_id). Read max_hy_allocation_pct,
duration_band_years, issuer_concentration_limit_pct,
subsector_min_count_for_diversified.
- Fetch
/api/market/energy for energy market signals and pitch themes.
- Filter candidates:
candidate: true, energy_linked: true, issuer not on
watchlist, rating and duration consistent with the constraint policy.
- Select the required number of BUYs with the prescribed total notional. Prefer
candidates aligned with positive energy signals (LNG, gas demand) and avoid
watchlisted issuers or subsectors.
- Build post-trade holdings by merging current holdings with proposed buys,
then run scripts/weighted_metrics.py.
- Check constraints: HY cap, duration band, issuer diversification (no issuer
exceeds the concentration limit), subsector diversification (at least the
minimum distinct subsectors among selections), watchlist avoidance.
- Set
sales_positioning from the template's allowed values, choosing a
segment and theme that match the desk's client context and the selected
bonds' theme tags.
- Set
data_precedence to current_environment_over_stale_payload when the
local payload carries stale data.
International Equity Correlation Review
When the prompt requests a correlation review for an international equity
portfolio:
- Read the answer template and the review request payload for the review window
(
level_start_date, level_end_date) and index universe.
- Fetch
/api/index-levels (bulk) or individual /api/index-levels/{id} for
each index in the universe.
- Fetch
/api/policies for correlation thresholds (correlation_high_threshold,
correlation_low_threshold).
- Compute pairwise Pearson correlations across all index pairs using
scripts/correlation.py. Extract the highest
positive and lowest correlation pairs.
- Identify concentration: check if the highest correlation exceeds the high
threshold. Look for China-Asia dependence patterns (IDX_CHINA paired with
regional indices). Set
china_asia_dependence_flag, primary_code, and
high_threshold_breached from the template's allowed values.
- Identify diversification candidates: indices with low correlations to the
dominant concentrated indices.
- Propose sleeve actions from the template's allowed action set (
trim, add,
hold, hedge, monitor, rotate). Match actions to the concentration
and diversification findings. Sort sleeves alphabetically.
Active Allocation View Refresh
When the prompt requests an allocation view refresh for a target quarter:
- Read the answer template and the allocation request for
focus_opportunity_sets,
target_quarter, prior_quarter.
- Fetch
/api/allocation/opportunity-sets for the asset class mapping of each
opportunity set.
- Fetch
/api/allocation/prior-views and filter to records where
quarter equals the target_quarter and previous_quarter equals
prior_quarter. These give the Q1→Q2 view and conviction for each
opportunity set.
- Fetch
/api/macro-signals and filter to target_quarter. These give the
current score and rationale_code for each opportunity set.
- Fetch
/api/policies for the allocation_mapping policy: use
view_score_thresholds to map signal scores to views (score ≥ OW_min → OW,
score ≤ UW_max → UW, else N). Use conviction_thresholds to map absolute
scores to conviction levels.
- For each focused opportunity set, determine the new view from the signal
score. Compare to the prior-quarter view to compute
change (UP, DOWN,
UNCHANGED). Use the rationale_code from the macro signal record.
- Select a risk overlay: review overall signal direction across all
opportunity sets. Choose from the template's overlay options. Provide
rationale codes in business-priority order (highest priority first).
- Use the top-level
policy_id from /api/policies as the policy_id field.
Fixed-Income Risk Rebalance
When the prompt requests a credit-risk rotation for a fixed-income portfolio:
- Read the answer template and meeting memo for the portfolio, rebalance
preferences, and target reductions.
- Fetch
/api/portfolios/{portfolio_id}/holdings for current positions.
- Fetch
/api/instruments/bonds for the full bond universe.
- Fetch
/api/issuers for watchlist status and credit outlook.
- Fetch
/api/policies for the portfolio's constraint policy. Read
max_hy_allocation_pct, duration_band_years, target_hy_reduction_pct,
issuer_concentration_limit_pct.
- Identify SELL candidates: holdings that are HY, on watchlist, or identified
in the meeting memo as pressure points. Sell enough to meet the target HY
reduction.
- Identify BUY candidates:
candidate: true, IG-rated, issuer not on
watchlist, duration consistent with keeping the portfolio inside the
duration band. Use candidates from the memo's shortlist when they pass
constraint checks, but reject any where the issuer is watchlisted.
- Build post-trade holdings, compute metrics with
scripts/weighted_metrics.py.
- Check constraints: HY cap, duration band, target HY reduction met,
watchlist exposure cleared.
- Fill
watchlist_handling: identify which sold instruments are on the
watchlist, confirm buys avoid watchlisted issuers.
- Set
risk_note_code from the template's allowed values based on the most
material risk concern addressed.
Multi-Asset Committee Decision
When the prompt requests a committee JSON linking correlation findings to
allocation views:
- Read the answer template and committee request for the focused opportunity
sets, index IDs, and review quarter.
- Run both the correlation review and allocation view refresh workflows for
the specified subsets (indices and opportunity sets).
- Fetch
/api/index-levels for the specified index IDs and compute the
highest-concentration and best-diversifier pairs using
scripts/correlation.py.
- Fetch
/api/allocation/prior-views and /api/macro-signals for the
specified opportunity sets. Compute signal-based views and changes.
- Determine
rebalance_trigger: if the highest correlation exceeds the policy
threshold, use correlation_cap_breach. Match other trigger options to the
dominant risk finding.
- Set
portfolio_risk_concentration_flag to true when the concentration
pair breaches the correlation threshold.
- Set
next_step based on whether constraints are breached and the severity
of findings.
- Sort all list items per the template's ordering rules.
Rounding and Precision
Every template declares precision explicitly per field. Follow these rules:
- Correlation values: round to 3 decimal places. Use
scripts/correlation.py which guarantees this.
- Portfolio metrics (market_value, HY%, duration, YTW): round to 2 decimal
places. Use scripts/weighted_metrics.py.
- Notional values (quantity_usd_m): round to 1 decimal place.
- Signal scores: round to 3 decimal places as declared in the template.
- All list items must follow the template's declared sort order.
1---2name: asteria-investment-office-83description: "Institutional portfolio risk and allocation workflows for the Asteria Investment Office shared environment. Use for fixed-income credit trades, international equity correlation reviews, active allocation view refreshes, credit risk rebalances, and multi-asset committee decisions. The environment exposes REST endpoints for portfolios, bonds, issuers, indices, index levels, policies, allocation taxonomy, prior views, macro signals, and energy markets. Task prompts reference client desks (energy credit, CIO, risk, investment committee) and provide structured answer templates. Do not use for general portfolio analytics or other investment data providers."4license: MIT5compatibility: designed for deepagents-code6metadata:7 source: https://skillmd.com/skills/prism-shadow/asteria-investment-office-88---910# Asteria Investment Office1112Work with the shared Asteria Investment Office environment to produce13portfolio-risk and allocation outputs. Every task provides an answer template14JSON — conform to its exact structure, key ordering, allowed values, and15precision.1617## Core Principle: API Over Local Payloads1819Local task payloads (desk_request, review_request, risk_meeting_memo, etc.)20are intake context only. They may carry stale marks, worksheet snapshots, or21preferences from earlier dates. The current environment API is the book of22record. When values differ, prefer the API and set the `data_precedence` field23to `current_environment_over_stale_payload` when the template includes it.2425## Environment Setup2627Read the `environment_access.md` file provided with each task for the base URL.28All endpoints are GET with no authentication. Start every task by reading the29API landing page (`GET /`) for endpoint discovery.3031API reference: [references/api.md](references/api.md). Load it when endpoint32details or field schemas are needed beyond what the task payload describes.3334## Scripts3536### Correlation Computation3738[scripts/correlation.py](scripts/correlation.py) — Computes Pearson correlation39of monthly simple returns from two index-level series.4041Usage: pipe a JSON object with `levels_a` and `levels_b` (each an array of42`{date, level}` objects) to stdin. Outputs `{correlation, return_observations}`.4344Use this script for all pairwise index correlations. Do not implement correlation45manually. The script guarantees 3-decimal rounding consistent with the policy46thresholds.4748### Portfolio Weighted-Average Metrics4950[scripts/weighted_metrics.py](scripts/weighted_metrics.py) — Computes51post-trade / post-rotation portfolio metrics from enriched holding-level data.5253Usage: pipe a JSON object with `holdings` (array of `{quantity_usd_m, instrument}`54where `instrument` is the full bond object from `/api/instruments/bonds`) to55stdin. Outputs `total_market_value_usd_m`, `hy_allocation_pct`,56`weighted_modified_duration_years`, `weighted_yield_to_maturity_pct`. All57values rounded to 2 decimal places.5859Build the input by merging current portfolio holdings with proposed trades60(adding BUY quantities, removing SELL quantities) and attaching the full bond61record to each holding.6263## Workflows6465### Energy Credit Trade Strategy6667When the prompt requests a trade package for an energy credit portfolio:68691. Read the answer template for required structure, precision, and allowed values.702. Fetch `/api/portfolios/{portfolio_id}/holdings` for current positions.713. Fetch `/api/instruments/bonds` for the full bond universe.724. Fetch `/api/issuers` for watchlist status and credit outlook.735. Fetch `/api/policies` for the portfolio's constraint policy (match via74 the portfolio's `constraint_policy_id`). Read `max_hy_allocation_pct`,75 `duration_band_years`, `issuer_concentration_limit_pct`,76 `subsector_min_count_for_diversified`.776. Fetch `/api/market/energy` for energy market signals and pitch themes.787. Filter candidates: `candidate: true`, `energy_linked: true`, issuer not on79 watchlist, rating and duration consistent with the constraint policy.808. Select the required number of BUYs with the prescribed total notional. Prefer81 candidates aligned with positive energy signals (LNG, gas demand) and avoid82 watchlisted issuers or subsectors.839. Build post-trade holdings by merging current holdings with proposed buys,84 then run [scripts/weighted_metrics.py](scripts/weighted_metrics.py).8510. Check constraints: HY cap, duration band, issuer diversification (no issuer86 exceeds the concentration limit), subsector diversification (at least the87 minimum distinct subsectors among selections), watchlist avoidance.8811. Set `sales_positioning` from the template's allowed values, choosing a89 segment and theme that match the desk's client context and the selected90 bonds' theme tags.9112. Set `data_precedence` to `current_environment_over_stale_payload` when the92 local payload carries stale data.9394### International Equity Correlation Review9596When the prompt requests a correlation review for an international equity97portfolio:98991. Read the answer template and the review request payload for the review window100 (`level_start_date`, `level_end_date`) and index universe.1012. Fetch `/api/index-levels` (bulk) or individual `/api/index-levels/{id}` for102 each index in the universe.1033. Fetch `/api/policies` for correlation thresholds (`correlation_high_threshold`,104 `correlation_low_threshold`).1054. Compute pairwise Pearson correlations across all index pairs using106 [scripts/correlation.py](scripts/correlation.py). Extract the highest107 positive and lowest correlation pairs.1085. Identify concentration: check if the highest correlation exceeds the high109 threshold. Look for China-Asia dependence patterns (IDX_CHINA paired with110 regional indices). Set `china_asia_dependence_flag`, `primary_code`, and111 `high_threshold_breached` from the template's allowed values.1126. Identify diversification candidates: indices with low correlations to the113 dominant concentrated indices.1147. Propose sleeve actions from the template's allowed action set (`trim`, `add`,115 `hold`, `hedge`, `monitor`, `rotate`). Match actions to the concentration116 and diversification findings. Sort sleeves alphabetically.117118### Active Allocation View Refresh119120When the prompt requests an allocation view refresh for a target quarter:1211221. Read the answer template and the allocation request for `focus_opportunity_sets`,123 `target_quarter`, `prior_quarter`.1242. Fetch `/api/allocation/opportunity-sets` for the asset class mapping of each125 opportunity set.1263. Fetch `/api/allocation/prior-views` and filter to records where127 `quarter` equals the `target_quarter` and `previous_quarter` equals128 `prior_quarter`. These give the Q1→Q2 view and conviction for each129 opportunity set.1304. Fetch `/api/macro-signals` and filter to `target_quarter`. These give the131 current `score` and `rationale_code` for each opportunity set.1325. Fetch `/api/policies` for the `allocation_mapping` policy: use133 `view_score_thresholds` to map signal scores to views (score ≥ OW_min → OW,134 score ≤ UW_max → UW, else N). Use `conviction_thresholds` to map absolute135 scores to conviction levels.1366. For each focused opportunity set, determine the new view from the signal137 score. Compare to the prior-quarter view to compute `change` (`UP`, `DOWN`,138 `UNCHANGED`). Use the `rationale_code` from the macro signal record.1397. Select a risk overlay: review overall signal direction across all140 opportunity sets. Choose from the template's overlay options. Provide141 rationale codes in business-priority order (highest priority first).1428. Use the top-level `policy_id` from `/api/policies` as the `policy_id` field.143144### Fixed-Income Risk Rebalance145146When the prompt requests a credit-risk rotation for a fixed-income portfolio:1471481. Read the answer template and meeting memo for the portfolio, rebalance149 preferences, and target reductions.1502. Fetch `/api/portfolios/{portfolio_id}/holdings` for current positions.1513. Fetch `/api/instruments/bonds` for the full bond universe.1524. Fetch `/api/issuers` for watchlist status and credit outlook.1535. Fetch `/api/policies` for the portfolio's constraint policy. Read154 `max_hy_allocation_pct`, `duration_band_years`, `target_hy_reduction_pct`,155 `issuer_concentration_limit_pct`.1566. Identify SELL candidates: holdings that are HY, on watchlist, or identified157 in the meeting memo as pressure points. Sell enough to meet the target HY158 reduction.1597. Identify BUY candidates: `candidate: true`, IG-rated, issuer not on160 watchlist, duration consistent with keeping the portfolio inside the161 duration band. Use candidates from the memo's shortlist when they pass162 constraint checks, but reject any where the issuer is watchlisted.1638. Build post-trade holdings, compute metrics with164 [scripts/weighted_metrics.py](scripts/weighted_metrics.py).1659. Check constraints: HY cap, duration band, target HY reduction met,166 watchlist exposure cleared.16710. Fill `watchlist_handling`: identify which sold instruments are on the168 watchlist, confirm buys avoid watchlisted issuers.16911. Set `risk_note_code` from the template's allowed values based on the most170 material risk concern addressed.171172### Multi-Asset Committee Decision173174When the prompt requests a committee JSON linking correlation findings to175allocation views:1761771. Read the answer template and committee request for the focused opportunity178 sets, index IDs, and review quarter.1792. Run both the correlation review and allocation view refresh workflows for180 the specified subsets (indices and opportunity sets).1813. Fetch `/api/index-levels` for the specified index IDs and compute the182 highest-concentration and best-diversifier pairs using183 [scripts/correlation.py](scripts/correlation.py).1844. Fetch `/api/allocation/prior-views` and `/api/macro-signals` for the185 specified opportunity sets. Compute signal-based views and changes.1865. Determine `rebalance_trigger`: if the highest correlation exceeds the policy187 threshold, use `correlation_cap_breach`. Match other trigger options to the188 dominant risk finding.1896. Set `portfolio_risk_concentration_flag` to `true` when the concentration190 pair breaches the correlation threshold.1917. Set `next_step` based on whether constraints are breached and the severity192 of findings.1938. Sort all list items per the template's ordering rules.194195## Rounding and Precision196197Every template declares precision explicitly per field. Follow these rules:198199- Correlation values: round to 3 decimal places. Use200 [scripts/correlation.py](scripts/correlation.py) which guarantees this.201- Portfolio metrics (market_value, HY%, duration, YTW): round to 2 decimal202 places. Use [scripts/weighted_metrics.py](scripts/weighted_metrics.py).203- Notional values (quantity_usd_m): round to 1 decimal place.204- Signal scores: round to 3 decimal places as declared in the template.205- All list items must follow the template's declared sort order.