A real-time financial simulation API built with Go, featuring League of Legends themed market tickers with live price movements implemented by Geometric Brownian Motion. Will need a jwt secret in your .env to use auth features
- Real-time Price Simulation: Continuous price updates using stochastic mathematical models
- RESTful API: Clean JSON endpoints for market data and user management
- Time-Series Database: MongoDB with optimized time-series collections and TTL indexes
Golang, Echo, Docker, MongoDB
| Symbol | Name | Drift | Volatility | Description |
|---|---|---|---|---|
MNT |
Mountain Dragon | 12% | 35% | Stable growth |
INF |
Infernal Dragon | 8% | 45% | Moderate risk |
ELD |
Elder Dragon | 15% | 60% | High growth |
CLD |
Cloud Dragon | 25% | 80% | Ultra volatile |
# Clone and start
git clone <repository-url>
cd api-project
# Start with Docker
docker-compose up --build -d
#See logs
docker ps
docker logs {image_name}
# API available at http://localhost:8080
Create an Account
curl -X POST http://localhost:8080/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"name": "Aatrox",
"email": "[email protected]",
"password": "fear"
}'This will output a token - which will be your auth bearer token.
Log In
curl -X POST http://localhost:8080/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "fear"
}'This will also give you your auth bearer token.
# Get all tickers
GET /api/tickers
# Get latest price for a ticker
GET /api/tickers/{symbol}/price# List all users
GET /api/users
# Get specific user
GET /api/users/{id}
# Create new user
POST /api/usersThese are protected routes. You will have to use your auth bearer wotken like so:
-H "Authorization: Bearer (Token goes here)"Uses Geometric Brownian Motion model:
S(t+1) = S(t) × exp((μ - 0.5σ²)Δt + σ√Δt × Z)
Where:
S(t)= Current priceμ= Drift (annual return)σ= Volatility (annual)Δt= Time step (1 second)Z= Random normal variable