Asteria Portfolio Analyst
Use the shared Asteria Investment Office environment service at the base URL
provided in the task description or environment_access.md. All portfolio,
instrument, issuer, index, and policy records come from that live service.
Local payloads provide intake context (request parameters, template shapes,
and stale worksheet notes) but must not be treated as the current book of
record. Always prefer the current environment response over any stale local
snapshot when the two conflict.
Environment
Base URL is read from the task-supplied environment_access.md or the task
prompt itself. The service uses no authentication. Allowed endpoints:
| Method | Path | Purpose |
|---|---|---|
| GET | / |
Service root / health ping |
| GET | /api/health |
Health check |
| GET | /api/portfolios |
List all portfolios |
| GET | /api/portfolios/{portfolio_id}/holdings |
Current holdings for a portfolio |
| GET | /api/instruments/bonds |
Bond instrument master |
| GET | /api/issuers |
Issuer metadata (sector, subsector, ratings, watchlist status) |
| GET | /api/market/energy |
Energy market data linked to bonds |
| GET | /api/indices |
Index metadata and identifiers |
| GET | /api/index-levels |
Monthly index levels across all indices |
| GET | /api/index-levels/{index_id} |
Monthly index levels for one index |
| GET | /api/allocation/opportunity-sets |
Opportunity set taxonomy |
| GET | /api/allocation/prior-views |
Prior-quarter allocation views |
| GET | /api/macro-signals |
Macro signal scores for the current quarter |
Core Principles
Data Precedence
The environment service is the authoritative source. When a local payload
contains stale marks, snapshot dates, or unreconciled worksheets, discard
those values in favor of the current environment response. Set the answer
field data_precedence (or equivalent) to current_environment_over_stale_payload
whenever the template includes it.
Use local payloads only for: the request structure, the output template contract, the list of instruments or opportunity sets to examine, and any qualitative meeting context. Any quantitative field (market values, yields, ratings, durations, allocation percentages, signal scores) must come from the environment.
Template Compliance
Every task includes an answer_template.json in its input/payloads/
directory. Read it before writing output. Follow it exactly:
- Required keys: Every key listed as required must appear. Top-level required keys are non-negotiable.
- Enum values: Use only the
allowed_valueslisted. Never invent a value not present in the enum set. - Numeric precision: Match the declared
precisionfor every number. Values in the train answers use the declared precision exactly, e.g. 2 decimals for percentages, 3 decimals for Pearson correlations, 1 decimal for USD millions. - Ordering: Follow the ordering rules declared in the template (e.g.
ascending by
instrument_id, SELL before BUY, the order of thefocus_opportunity_setslist from the payload). - Required values: When a field has
required_value, output that exact value (e.g. theportfolio_idfield must match itsrequired_valueexactly).
API Query Strategy
Query the environment in parallel whenever the endpoints are independent:
Portfolio holdings:
GET /api/portfolios/{id}/holdingsreturns the current portfolio with each holding'sinstrument_id,market_value_usd,quantity_usd_m,weight, andmodified_duration_years.Bond instruments:
GET /api/instruments/bondsreturns all bonds withinstrument_id,issuer_id,coupon_rate_pct,maturity_date,yield_to_maturity_pct,modified_duration_years,rating,hy_flag,subsector, andwatchlist_flag.Issuers:
GET /api/issuersreturns issuer-level metadata:issuer_id,issuer_name,sector,subsector,rating,watchlist_flag,country.Index levels:
GET /api/index-levels/{index_id}or the bulkGET /api/index-levelsreturns a list of objects withindex_id,level_date, andindex_level.Macro signals:
GET /api/macro-signalsreturns signal scores per opportunity set and per quarter. Each entry hasopportunity_set,quarter,signal_score, and arationale_code(or similar recommendation field).Prior views:
GET /api/allocation/prior-viewsreturns the previous quarter's views (UW,N,OW) per opportunity set.Opportunity sets:
GET /api/allocation/opportunity-setsreturns the taxonomy mappingopportunity_settoasset_classand other metadata.Energy market:
GET /api/market/energyreturns energy-market context per instrument (used for credit desk energy-linked bond selection).
Post-Trade Portfolio Math
When constructing buy/sell trade packages, compute post-trade metrics using market-value-weighted formulas:
Post-trade market value:
post_mv = current_total_mv + sum(buys notional) - sum(sells notional)
Note: sells remove holdings. When selling an existing holding, the quantity
sold cannot exceed its current market_value_usd or quantity_usd_m in the
portfolio. The answer should reflect the actual quantity removed.
Post-trade HY allocation percentage:
post_hy_pct = 100 * (sum of post-trade market values of all HY-flagged holdings) / post_mv
Recompute by: take the current HY holdings, remove any HY holdings that are sold (fully or partially), add any new HY buys, then divide by post_mv.
HY reduction in percentage points:
hy_reduction_ppt = current_hy_pct - post_hy_pct
Post-trade weighted modified duration:
post_dur = sum(holding_mv_i * holding_dur_i) / post_mv
for all holdings after trades. Use each bond's modified_duration_years
from the bond instrument master.
Post-trade weighted YTM:
post_ytm = sum(holding_mv_i * holding_ytm_i) / post_mv
Constraint Checks
Every trade recommendation must pass or explicitly flag these constraints:
HY cap: The portfolio's post-trade HY allocation percentage must not
exceed the policy cap. Check the policy endpoint or infer from context
(train answers suggest a cap around 20-25%). Set hy_cap_pass to true
if post_trade_hy <= cap, false otherwise.
Duration band: The post-trade weighted modified duration must fall
within the CIO-approved band. When the task mentions a CIO range, check
that post_trade_duration_years is inside it. Set duration_band_pass
accordingly.
Issuer diversification: The selected instruments (buys) must not all
belong to the same issuer. At least two distinct issuers among the buys.
Set selected_issuer_diversification_pass accordingly.
Subsector diversification: The selected instruments must span at least
two different subsectors. Set selected_subsector_diversification_pass
accordingly.
Watchlist avoidance: No buy ticket may involve an instrument whose
issuer is on the watchlist. All sells of watchlisted instruments should be
flagged. Set watchlist_avoidance_pass to true only if zero buys touch
watchlisted issuers.
Pearson Correlation from Monthly Index Levels
When a task requires Pearson correlation between two equity indices:
- Query
GET /api/index-levels/{index_id}for each index in the universe. - Filter to monthly level records whose
level_datefalls within the specified review window (inclusive of start and end). - Sort by
level_dateascending. - Calculate simple monthly returns:
r_t = (level_t - level_{t-1}) / level_{t-1}. - Compute the Pearson correlation coefficient from the paired return series:
r = sum((x_i - mean_x) * (y_i - mean_y)) / sqrt(sum((x_i - mean_x)^2) * sum((y_i - mean_y)^2))
- Round to 3 decimal places.
- The number of return observations is
(number of level records used) - 1.
Extreme pair identification (for concentration/diversification tasks):
highest_positive: Find the pair with the largest positive correlation. Break ties by alphabetical order of the pair id.lowest: Find the pair with the most negative (or smallest) correlation. Break ties by alphabetical order.- When the task asks for
highest_concentrationandbest_diversifier: highest concentration is the most positive correlation; best diversifier is the most negative (lowest) correlation.
Concentration detection:
- Flag
china_asia_dependence_flagastruewhen the correlation betweenIDX_CHINAandIDX_AC_ASIA_PAC_EX_JPexceeds a high threshold (around 0.85-0.90 based on train evidence). - Set
primary_codetoCHINA_ASIA_DEPENDENCEwhen that pair dominates. - Set
high_threshold_breachedtotruewhen the relevant pair correlation exceeds the threshold.
Allocation View Derivation
For each requested opportunity set:
- Look up its
asset_classfrom/api/allocation/opportunity-sets. - Look up the prior view from
/api/allocation/prior-viewsfor the prior quarter. - Look up the current macro signal score from
/api/macro-signalsfor the target quarter and opportunity set. - Determine the view:
signal_score > 0.3suggestsOW(overweight)signal_score < -0.3suggestsUW(underweight)-0.3 <= signal_score <= 0.3suggestsN(neutral) These thresholds are guidelines; the environment signal scores and rationale codes are the definitive source. When the environment provides explicitrationale_codevalues per opportunity set, use them directly.
- Determine change versus prior:
- If prior view is
Nand new view isOW->UP - If prior view is
Nand new view isUW->DOWN - If prior view is
OWand new view isUW->DOWN - If prior view is
UWand new view isOW->UP - If prior equals new ->
UNCHANGED
- If prior view is
- Assign conviction:
HIGHwhen the absolute signal score is well above threshold and the direction is unambiguous.MEDIUMwhen the signal is directional but moderate.LOWwhen the signal is near zero or mixed.
- Assign
rationale_codefrom the environment's macro signals for that opportunity set; if not directly available, derive from the allowed_values list using the pattern of the signal direction.
Risk Overlay Selection
When the task requires a portfolio-level risk overlay, select from the
template's overlay_code_choices. Derive by counting the dominant themes
across the allocation views:
- If multiple duration-support / rate-cut-support / quality-tilt signals
dominate:
DURATION_QUALITY_TILT - If credit HY valuation risk signals dominate:
CREDIT_RISK_REDUCTION - If equity cyclical signals dominate:
EQUITY_BETA_EXTENSION - If dollar defensive / currency hedge signals dominate:
CURRENCY_DEFENSIVE_HEDGE - If no clear tilt:
NO_OVERLAY
The rationale_codes list for the overlay should be the top rationale codes
from the allocation views that align with the overlay direction, ordered by
business priority (highest priority first).
Combined Correlation and Allocation Integration
When a task combines correlation analysis and allocation views (committee pattern):
- Compute the full pairwise correlation matrix for the requested index set using the 12-month monthly-level window.
- Identify the highest-concentration pair and best-diversifier pair.
- Derive sleeve actions (
trim,add,hold,hedge) based on combined correlation + allocation view signals:trimfor opportunity sets with negative/bearish views and high concentration correlations.addfor opportunity sets with positive/bullish views and favorable diversification characteristics.hedgefor currency sleeves when the signal is defensive.holdfor neutral views with no concentration pressure.
- Select
rebalance_triggerfrom the template's enum:correlation_cap_breachwhen a concentration pair exceeds the thresholdcommittee_reviewwhen this is a scheduled review with no breach- Other codes when those conditions are the primary driver.
- Set
portfolio_risk_concentration_flagtotruewhen any concentration threshold is breached. - Set
next_stepbased on the overall risk picture:approve_with_monitoringwhen recommendations are moderate and constraints are satisfied.approve_rotationwhen a clear rotation is warranted and passes checks.defer_pending_risk_reviewwhen there is unresolved risk data.reject_constraint_breachwhen a constraint is violated.
Bond Selection for Credit Trade Packages
For credit trade packages that require buy tickets with income focus:
- Query
/api/instruments/bondsand/api/issuersand/api/market/energyto build the eligible bond universe. - Filter to energy-linked bonds (energy sector, LNG, gas, or relevant subsectors).
- Exclude bonds whose issuer is on the watchlist.
- Among remaining candidates, prefer bonds with higher YTM (better carry), IG rating (safer credit), and moderate duration.
- Ensure issuer and subsector diversification among the selected buys.
- Each BUY ticket notional must match the split requested in the desk request (total notional divided equally across the ticket count).
- The
sales_positioningfields:target_segment: match the client context from the desk request (e.g.multi_asset_incomefor income-pitch tasks,insurance_general_accountfor liability-matching).theme: select the best-fitting theme from the template enum. For LNG/gas-focused selections,lng_export_tailwind; for midstream bonds,midstream_stability; for cautionary contexts,oil_oversupply_caution; etc.
Sleeve Action Derivation
For tasks that derive sleeve actions from correlation analysis:
- Map each requested opportunity set or index to its sleeve name.
- Determine action:
trimwhen the opportunity set/index has high concentration correlation with a dominant sleeve AND the allocation signal is bearish or the CIO concern memo flags concentration.addwhen the opportunity set/index is a diversification candidate (low or negative correlation with the concentration pair) AND the allocation signal is supportive.hedgefor currency sleeves when the dollar is defensive.holdormonitorwhen signals are neutral.
target_index_idmust be one of the allowed values from the template.- Order sleeve actions as specified by the template.
Exception Flags for FI Risk Rebalances
For fixed-income risk rebalance rotations:
- Compute all post-trade risk metrics as described in "Post-Trade Portfolio Math" above.
- Set exception flags:
hy_cap_pass: post-trade HY% <= policy capduration_band_pass: post-trade duration within CIO rangetarget_hy_reduction_met: hy_reduction_ppt >= the minimum requested in the meeting memowatchlist_exposure_cleared: post-trade watchlist exposure in USD m is zero or minimal
watchlist_handling:watchlist_sell_ids: list of instrument_ids sold that were on the watchlist, in ascending alphabetical order.buys_avoid_watchlist:trueif no buy ticket involves a watchlisted issuer.
risk_note_code: Select the code that best characterizes the dominant risk factor addressed by the rotation:watchlist_concentrationwhen watchlist exposure was the primary driverhy_cap_pressurewhen HY cap was the binding constraintduration_preservationwhen duration maintenance shaped the pickscarry_tradeoffwhen carry sacrifice was notedno_actionwhen no material change was needed (rare in rebalance tasks)
Common Output Conventions
- Dates: Always use
YYYY-MM-DDformat. Theas_of_dateshould reflect the date of the current environment data used, not the stale local payload date. - JSON only: Do not wrap the output in markdown code fences, commentary, or extra text unless the task explicitly asks for a narrative section.
- Field ordering in lists: Follow the template's declared ordering. When the template says "Sort ascending by instrument_id", do exactly that. When it says "SELL before BUY", group sells first.
- Strings vs numbers: Never quote numeric values. Booleans are
unquoted
true/false. All string fields use double quotes. - Empty or null: The train answers never use
null. If a field is required, it must be present with a valid value. Lists must not be empty unless the template allows it.
Quick-Start Workflow
- Read the task
prompt.txtto understand the assignment and portfolio id. - Read every file under
input/payloads/— especiallyanswer_template.jsonfor the output contract and the request/memo JSON for intake parameters. - If an
environment_access.md(or similar) is provided, note the base URL. - Query all relevant environment endpoints in parallel:
- Holdings for the target portfolio
- Bond instrument master (if bond tasks)
- Issuer master (if bond or credit tasks)
- Index levels for all requested indices (if correlation tasks)
- Macro signals and prior views (if allocation tasks)
- Opportunity sets (if allocation tasks)
- Compute derived values (correlations, post-trade metrics, signal-derived views).
- Construct the output JSON conforming to every rule in the template.
- Verify every required key, enum value, precision, and ordering rule before returning.