Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
69 lines (62 loc) · 2.17 KB
/
Copy path.env.example
File metadata and controls
69 lines (62 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Server Configuration
PORT=8080
SERVER_READ_TIMEOUT=15s
SERVER_WRITE_TIMEOUT=15s
SERVER_IDLE_TIMEOUT=60s
SERVER_SHUTDOWN_TIMEOUT=10s
# Engine Configuration
TRADE_LOG_PATH=trades.log
# Order Cleanup (Background goroutine to clean filled/cancelled orders)
# WARNING: This is an experimental feature. Set to false if you want to keep all order history.
# When enabled, orders are periodically removed from the tracking map after they're filled/cancelled.
ORDER_CLEANUP_ENABLED=false
ORDER_CLEANUP_INTERVAL=5m
# API Configuration
DEFAULT_ORDER_LIMIT=100
MAX_ORDER_LIMIT=1000
DEFAULT_TRADE_LIMIT=100
MAX_TRADE_LIMIT=1000
DEFAULT_ORDERBOOK_DEPTH=10
MAX_ORDERBOOK_DEPTH=10
# Logger Configuration
# Valid values: DEBUG, INFO, WARN, ERROR
LOG_LEVEL=INFO
# Memory Storage Configuration
# Set MEMORY_ENABLED=false to disable in-memory caching layer
# MEMORY_MAX_ORDERS: Maximum number of inactive orders to cache in memory (active orders are always in orderbook)
# MEMORY_MAX_TRADES: Maximum number of recent trades to cache in memory
MEMORY_ENABLED=true
MEMORY_MAX_ORDERS=100000
MEMORY_MAX_TRADES=1000
# Database Configuration (PostgreSQL)
# Set DATABASE_ENABLED=true to persist orders and trades to PostgreSQL
# When disabled, uses in-memory storage only
DATABASE_ENABLED=false
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_NAME=matching_engine
DATABASE_USER=postgres
DATABASE_PASSWORD=
DATABASE_MAX_CONNECTIONS=20
DATABASE_MAX_IDLE_CONNECTIONS=5
DATABASE_CONN_MAX_LIFETIME=5m
DATABASE_SSL_MODE=disable
# Redis Configuration (Distributed Cache)
# Set REDIS_ENABLED=true to use Redis for distributed caching
# When disabled, caching is in-memory only
# REDIS_TLS_ENABLED: Enable TLS/SSL for encrypted connections (required for Upstash, AWS ElastiCache with encryption, etc.)
# REDIS_ORDER_TTL: Time-to-live for orders in Redis cache
# REDIS_MAX_ORDERS: Maximum number of orders to cache (FIFO eviction)
# REDIS_MAX_TRADES: Maximum number of recent trades to cache (FIFO eviction)
REDIS_ENABLED=false
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0
REDIS_TLS_ENABLED=false
REDIS_MAX_RETRIES=3
REDIS_POOL_SIZE=10
REDIS_MIN_IDLE_CONNS=2
REDIS_ORDER_TTL=24h
REDIS_MAX_ORDERS=50000
REDIS_MAX_TRADES=10000