# Economy Module - Pure Market Logic ## Context You are working EXCLUSIVELY on economic simulation logic. No infrastructure, no networking, no threading. ## Responsibilities - **Market simulation**: Supply/demand, pricing dynamics - **Trading**: Buy/sell orders, market makers, price discovery - **Economic indicators**: Inflation, growth, market health - **Resource valuation**: Dynamic pricing based on scarcity/abundance ## Interface Contract ```cpp // Input JSON examples: { "type": "market_update", "item": "steel_plate", "supply": 1000, "demand": 800 } { "type": "trade", "action": "buy", "item": "copper_ore", "quantity": 50, "max_price": 2.5 } // Output JSON examples: { "status": "trade_executed", "item": "copper_ore", "quantity": 50, "price": 2.3, "total_cost": 115.0 } { "market_data": { "steel_plate": {"price": 5.2, "trend": "rising"}, "copper_ore": {"price": 2.3, "trend": "stable"} } } ``` ## Build Commands ```bash cd modules/economy/ cmake . # Build from THIS directory make economy-module # Generates economy.so make test-economy # Run isolated tests ./build/economy-module # Test the module ``` ## File Limits - **EconomyModule.cpp**: Max 300 lines - **Pure logic only**: No sockets, threads, or engine dependencies - **JSON in/out**: All communication via JSON messages ## Focus Areas 1. Market algorithms (supply/demand curves, price elasticity) 2. Trading mechanics (order books, market makers) 3. Economic modeling (inflation, economic cycles) Claude Code should NEVER leave this directory or reference parent paths!