A full-featured token economy simulator for the ViWO Protocol with Next.js frontend and Python FastAPI backend, supporting deterministic calculations, Monte Carlo simulations, and Agent-Based modeling with WebSocket streaming for real-time results.
- Deterministic: Real-time calculations with same inputs producing same outputs
- Monte Carlo: Run 1,000-10,000 simulations with randomized parameters to understand probability distributions
- Agent-Based: Simulate individual user behaviors (creators, consumers, whales, bots) with market dynamics
- Identity: User tiers, verification, profile transfers, marketplace sales
- Content: Post fees, NFT minting, premium content, content sales
- Community: Community subscriptions, events, verification, analytics
- Advertising: Banner/video ads, promoted posts, campaigns, analytics
- Messaging: Encrypted DMs, group chats, file transfers, voice/video calls
- Token burn mechanics
- Buyback programs
- Staking incentives
- Treasury accumulation
- Reward recapture tracking
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- Recharts for visualizations
- WebSocket for real-time updates
- Python 3.11
- FastAPI
- NumPy/SciPy for simulations
- WebSocket support
- Pydantic for validation
- Node.js 18+
- Python 3.11+
- npm or yarn
cd frontend
npm install
npm run devThe frontend will be available at http://localhost:3000
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reloadThe backend will be available at http://localhost:8000
docker-compose upGET /api/health- Health checkPOST /api/simulate/deterministic- Run deterministic simulationPOST /api/simulate/monte-carlo- Run Monte Carlo simulationPOST /api/simulate/agent-based- Run agent-based simulationGET /api/presets- Get preset configurationsPOST /api/export- Export results (JSON/CSV)
WS /ws/simulation/{job_id}- Stream simulation progress
-
Adjust Parameters: Use the interactive controls to set token price, marketing budget, fees, and other parameters.
-
Select Simulation Type:
- Deterministic for quick calculations
- Monte Carlo for risk analysis
- Agent-Based for behavior simulation
-
View Results:
- Module-by-module revenue breakdown
- Recapture flow visualization
- Token velocity metrics
- Distribution charts (Monte Carlo)
- Agent behavior analysis
-
Export: Save parameters and results as JSON or CSV
- Lean Bootstrap ($50K/yr): Conservative growth with minimal marketing
- Base Case ($150K/yr): Balanced growth strategy
- Growth Phase ($250K/yr): Aggressive user acquisition
- Year 2+ Scale ($400K/yr): Established brand with strong growth
Simulator/
├── frontend/
│ ├── src/
│ │ ├── app/ # Next.js pages
│ │ ├── components/ # React components
│ │ ├── hooks/ # Custom hooks
│ │ ├── lib/ # Utilities
│ │ └── types/ # TypeScript types
│ └── package.json
│
├── backend/
│ ├── app/
│ │ ├── core/ # Simulation engines
│ │ ├── models/ # Pydantic models
│ │ ├── routers/ # API endpoints
│ │ └── services/ # Background services
│ └── requirements.txt
│
└── docker-compose.yml
MIT License