





Ultimate Stock Market Simulation Framework for Unity
Build your own real-time stock market world — complete with AI traders, social sentiment, and dynamic events.
Whether you're creating a serious financial simulator or a chaotic meme-stock adventure, this framework gives you the tools to make it real.
Start trading your virtual market today.
Overview
Ultimate Stock Market Simulation Framework is a complete and extensible financial simulation engine built with Unity.
It replicates a real-time trading environment — with order book mechanics, AI traders, dynamic news feeds, and narrative market events — making it ideal for:
- Financial & business simulation games
- Trading education or training apps
- AI trading experiments and backtesting prototypes
- Fintech visualization and marketing demos
Everything is modular, event-driven, and fully customizable.
Core Features
Real-Time Trading Engine
- Full order book mechanics (limit / market orders, partial fills, cancellations)
- Thread-safe order matching with coroutine-based parallel processing
- Configurable batch processor for high-frequency trading performance
AI Trader & Market Maker
- Multiple AI trader types: AITrader, SimpleCommandTrader, MarketMaker
- Realistic market participation, liquidity simulation, and command-based manipulation
- Fully extensible — add your own trading agents easily
Dynamic News & Social Media System
- Event-driven news articles and simulated social posts
- Influencers and sentiment-driven reactions
- Integrated with Scenario System for organic storytelling
Scenario & Event Framework
- JSON-defined narrative events (time, stock, or random triggers)
- Event actions: publish news, modify prices, post SNS, issue trader commands
- Full control of in-game macro events and crisis simulations
Character & Relic System
- Select trader archetypes (AntTrader, MemeTrader, etc.)
- Each character has unique trading traits
- Collect relics with gameplay bonuses (profit boost, fee reduction, early news)
Modular & Scalable Architecture
- Manager-based system with dependency-safe initialization
- EventManager for decoupled communication between systems
- Easy integration with your own UI, data, or gameplay extensions
System Architecture Highlights
- Event-Driven Architecture — clean Observer pattern communication
- Object Pooling — efficient reuse of SNS posts, order rows, and events
- Parallel Processing — each stock trades in its own coroutine
- Data-Driven Design — scenarios and company info via JSON and ScriptableObjects
- Expandable Modules — add new stocks, AI traders, or relics without modifying core logic
Includes full documentation with diagrams and an AI assistant guide for developers.
What’s Included
- Full C# Source Code
- Complete Trading Engine
- AI Trader System (3 base implementations)
- News + SNS Information System
- Scenario/Event System with JSON support
- Character & Relic Framework
- 25+ Modular UI Components
- Detailed Documentation & AI Assistant Guide (Markdown)
- Ready-to-run Demo Scenes
Extensibility Examples
Add a New Stock
Register via CompanyManager or VirtualAssetsGenerator — auto-populated in StockMarketSystem and UI
Add a New Scenario
Create a JSON file in /Resources/Scenarios/, define triggers (time / price / random) and actions
Add a New Character
Inherit from BasePlayerCharacter and implement InitializeTraits()
Add a New Relic
Inherit from Relic and implement ApplyEffect() / RemoveEffect()
Performance Optimizations
- BatchOrderProcessor: Groups and processes orders per frame
- EventBatchProcessor: Efficient event queuing and delivery
- Frame-Time Budgeting: EventManager caps to 8 ms per frame
- Coroutine-based Distribution: Smooth performance for 20+ stocks
- Object Pools: Minimized GC pressure during gameplay
Perfect For
- Game Developers – create realistic investment or trading games
- Educators – teach stock trading dynamics interactively
- AI Researchers – simulate trading agents or reinforcement learning environments
- Fintech Teams – prototype market behaviors or test UX flows
Documentation Included
Three developer-ready documents:
- PROJECT_OVERVIEW.md — Full system summary
- AI_ASSISTANT_GUIDE.md — AI-powered development guidance
- ARCHITECTURE.md — Architecture diagrams and dependency maps
Each includes initialization order, event flows, and modular extension points.