Open
Phase 2A: WHAT/WHO/WHY intelligence layer — participant archetypes, IPO microstructure, DeepSeek motivation engine#7
Conversation
…ding, fix DATABASE_URL format
Copilot created this pull request from a session on behalf of
Netrade1
June 17, 2026 13:25
View session
Netrade1
marked this pull request as ready for review
June 18, 2026 05:10
Copilot
AI
changed the title
Phase 1: Institutional Microstructure Intelligence System — Research Prototype
Phase 2A: WHAT/WHO/WHY intelligence layer — participant archetypes, IPO microstructure, DeepSeek motivation engine
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements Phase 2A of the system: real-time three-question analysis for every order event — WHAT is being ordered, WHO is placing it (behavioural archetype, never identity), and WHY they are placing it (motivation taxonomy). Adds SPCX IPO-specific microstructure detection and an optional DeepSeek-R1 reasoning engine.
New agents
ParticipantArchetypeAgent— scores 7 mutually exclusive archetypes (institutional_accumulator,retail_sentiment_buyer,algorithmic_market_maker,momentum_ignitor,strategic_seller,informed_flow_proxy,unknown_mixed) from observable L2 signals; returns probability + compliance-cleared evidenceIPOMicrostructureAgent— classifies IPO trading phase (price_discovery,stabilisation,normal_trading, etc.), detects greenshoe-like bid support and lock-up proximity selling patterns;SPCXpre-configured viaIPO_SYMBOLSenv varMotivationInferenceAgent— maps dominant archetype to a 14-label taxonomy across accumulation / distribution / neutral motivations; rule-based engine always runs first, DeepSeek-R1 enriches the reasoning trace whenDEEPSEEK_API_KEYis set (silent fallback if unavailable)Pipeline integration
All three agents wired into
Orchestrator.process()after the existing Phase 1 agents.DecisionParliament.deliberate()accepts them as optional kwargs — fully backward compatible. Archetype votes now contribute to bullish/bearish conviction tallying. Motivation reports written to the Audit Ledger via newlog_motivation().Extended chatbot commands
Config additions (
.env.example)Compliance
Phase 2A outputs are fully compliance-gated: archetypes are behavioural labels only, motivation inferences are probabilistic hypotheses, DeepSeek reasoning traces are stored in the immutable Audit Ledger. Compliance Agent veto authority unchanged.