← Catalog

@mporenta/pi-trading-quant-chain

Pi extension package for a sequential ML/algo-trading quant agent chain.

Extension

Install

Install with PiG

pig install npm:@mporenta/pi-trading-quant-chain

Install with Pi

pi install npm:@mporenta/pi-trading-quant-chain
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./trading-quant-chain.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.21 (README.md). PiG does not review it.

@mporenta/pi-trading-quant-chain

Pi package for a sequential machine-learning / algo-trading agent pipeline:

trading-quant-researcher ──▶ trading-quant-architect ──▶ trading-quant-planner ──▶ trading-quant-developer ──▶ trading-quant-reviewer

The extension registers the --trading-quant-chain flag, /trading-quant-chain commands, a status widget, and the run_trading_quant_chain tool.

Install

pi install npm:@mporenta/pi-trading-quant-chain

Or run for one session without installing:

pi -e npm:@mporenta/pi-trading-quant-chain --trading-quant-chain

After installing, launch Pi with:

pi --trading-quant-chain

What's included

  • trading-quant-chain.ts — extension entrypoint and chain runner.
  • themeMap.ts — optional theme compatibility helper.
  • agents/agent-chain.yaml — bundled trading-quant chain definition.
  • agents/trading-quant-*.md — bundled researcher, architect, planner, developer, and reviewer definitions.
  • fixtures/fake-pi-child.mjs — deterministic fake child Pi for local no-provider smoke tests.

Project-local .pi/agents definitions take precedence when present; the bundled definitions are the fallback that makes the npm package self-contained.

Current behavior

  • The researcher runs before the architect so architecture follows concrete repo evidence.
  • The widget shows a full-width Current Agent activity panel above the chain cards.
  • Chain cards use distinct pending, running, complete, and error status colors.
  • Debug logging can capture step prompts, handoffs, child events, tool calls, token counts, lags, and developer delta metadata.
  • The reviewer receives a programmatic developer delta and should not fail solely on unrelated pre-existing dirty files.
  • If the reviewer returns CHAIN_RETRY_REQUIRED, the orchestrator automatically reruns the developer once, then reruns the reviewer. The retry limit is hard-coded to 1.

See trading-quant-chain.README.md for local development and debugging details.

Safety defaults

The chain defaults to research, simulation, dry-run, and paper-trading behavior. It reviews for leakage, look-ahead bias, backtest realism, transaction costs, slippage, timezones, calendars, broker/live-order safety, secrets, and operational risk.

Environment variables

VariableDefaultPurpose
TRADING_QUANT_CHAIN_PROGRESS_INTERVAL_MS15000User-visible progress throttle.
TRADING_QUANT_CHAIN_IDLE_TIMEOUT_MS900000Child idle timeout.
TRADING_QUANT_CHAIN_STEP_TIMEOUT_MS2700000Per-step max runtime.
TRADING_QUANT_CHAIN_DEBUG / ..._VERBOSEoffEnable JSONL debug logs.
TRADING_QUANT_CHAIN_DEBUG_MAX_CHARS20000Max characters stored for any single logged string.
TRADING_QUANT_CHAIN_DEBUG_HEARTBEAT_INTERVAL_MSprogress intervalFrequency for idle/lag heartbeat records.
TRADING_QUANT_CHAIN_DEBUG_RAW_CHILD_EVENTSoffLog raw child event type records.
TRADING_QUANT_CHAIN_DEBUG_STREAM_DELTASoffLog every streamed assistant text delta.