Finance & models
AuraScore 83/100

Algorithmic Portfolio Rebalancing System Specification

Author a detailed technical and mathematical specification for an automated, tax-aware portfolio rebalancing engine.

Use this template when designing or upgrading algorithmic trading and wealth management engines within fintech platforms. It delivers a comprehensive functional architecture specification covering drift monitoring, tax-loss harvesting, and trade execution staging.

Template

Role: Principal FinTech Systems Architect and Senior Quantitative Strategist with 15+ years designing institutional wealthtech execution engines.

Context

  • Target client segment: {{target_client_segment}}
  • Eligible asset classes and trading venues: {{eligible_asset_classes}}
  • Rebalancing trigger mechanisms: {{rebalancing_trigger_logic}}
  • Tax optimization and harvesting rules: {{tax_loss_harvesting_rules}}
  • Custodian and order routing endpoints: {{execution_broker_endpoints}}
  • Compliance, margin, and wash-sale restrictions: {{regulatory_restriction_set}}

Task

Author an exhaustive engineering and mathematical specification for an automated portfolio rebalancing model that continuously evaluates target allocations, isolates drift variances, executes tax-aware order generation, and complies with institutional execution parameters.

Method

  1. Define the mathematical drift calculation equations (percentage-of-portfolio vs relative drift) across asset class tiers for {{eligible_asset_classes}}.
  2. Formulate the triggering architecture evaluating scheduled cron cycles against intraday volatility breaches as defined in {{rebalancing_trigger_logic}}.
  3. Specify the lot-level tax optimization hierarchy incorporating {{tax_loss_harvesting_rules}} while enforcing wash-sale avoidance windows.
  4. Design the trade generation algorithm, defining order rounding, minimum trade sizes, cash buffer preservation, and transaction cost penalties.
  5. Map execution routing logic across {{execution_broker_endpoints}}, including order batching, FIX protocol parameters, and time-in-force instructions.
  6. Formulate pre-trade compliance checks validating constraints from {{regulatory_restriction_set}} prior to routing.
  7. Detail failure modes, reconciliation routines, post-trade settlement validation, and fallback procedures for illiquid or halted assets.

Constraints

  • MUST express all mathematical algorithms in clear pseudocode accompanied by LaTeX-style algebraic notation.
  • MUST NOT leave execution parameters undefined; all thresholds, tolerances, and rounding conventions must have explicit default values.
  • Output must maintain institutional rigor suitable for both quantitative engineers and regulatory compliance auditors.
  • Data schemas must specify variable types, precision standards, and update frequencies.

Output format

Provide the specification organized under these exact headers:

  1. Executive Summary & Architecture Overview
  2. Mathematical Foundations & Drift Trigger Mechanics
  3. Tax-Aware Optimization & Lot Selection Logic
  4. Order Staging, Sizing & Broker Routing Engine
  5. Pre-Trade Compliance & Risk Governance Matrix
  6. Data Dictionaries & Error-Handling Protocol Total length should be between 1,200 and 1,800 words.

Self-review

  1. Ensure every context variable is explicitly integrated into the architectural logic.
  2. Confirm pseudocode covers both drift detection and order generation paths without gaps.
  3. Validate that tax-loss harvesting rules strictly prevent wash-sale violations across accounts.
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

business-strategy
business-finance
financial-services
fintech
wealthtech
rebalancing