NATS_URL=nats://nats:4222
CLICKHOUSE_URL=http://clickhouse:8123
CLICKHOUSE_DATABASE=default
REDIS_URL=redis://redis:6379

API_PORT=4000
REST_DEFAULT_LIMIT=200
API_DELIVER_POLICY=new
API_CONSUMER_RESET=false

NPM_SHARED_NETWORK=npm-shared

# Recommended with NPM on the same Docker network:
# app.<domain> -> web:3000
# api.<domain> -> api:4000
# Leave NEXT_PUBLIC_API_URL empty to use same-origin mode
# (app.<domain> serves UI and proxies API paths to api:4000).
NEXT_PUBLIC_API_URL=https://api.example.com
NEXT_PUBLIC_NBBO_MAX_AGE_MS=1000

# Options ingest
OPTIONS_INGEST_ADAPTER=synthetic
ALPACA_API_KEY=
ALPACA_REST_URL=https://data.alpaca.markets
ALPACA_WS_BASE_URL=wss://stream.data.alpaca.markets/v1beta1
ALPACA_FEED=indicative
ALPACA_UNDERLYINGS=SPY,NVDA,AAPL
ALPACA_STRIKES_PER_SIDE=8
ALPACA_MAX_DTE_DAYS=30
ALPACA_MONEYNESS_PCT=0.06
ALPACA_MONEYNESS_FALLBACK_PCT=0.1
ALPACA_MAX_QUOTES=200

# Databento replay
DATABENTO_API_KEY=
DATABENTO_DATASET=OPRA.PILLAR
DATABENTO_SCHEMA=trades
DATABENTO_NBBO_SCHEMA=tbbo
DATABENTO_START=
DATABENTO_END=
DATABENTO_SYMBOLS=ALL
DATABENTO_STYPE_IN=raw_symbol
DATABENTO_STYPE_OUT=raw_symbol
DATABENTO_LIMIT=0
DATABENTO_PRICE_SCALE=1
DATABENTO_PYTHON_BIN=python3

# IBKR adapter (options)
IBKR_HOST=host.docker.internal
IBKR_PORT=7497
IBKR_CLIENT_ID=0
IBKR_SYMBOL=SPY
IBKR_EXPIRY=20250117
IBKR_STRIKE=450
IBKR_RIGHT=C
IBKR_EXCHANGE=SMART
IBKR_CURRENCY=USD
IBKR_PYTHON_BIN=python3

# Equities ingest
EQUITIES_INGEST_ADAPTER=synthetic
EMIT_INTERVAL_MS=1000
ALPACA_EQUITIES_FEED=iex

# Testing mode
TESTING_MODE=false
TESTING_THROTTLE_MS=200

# Compute and inference
COMPUTE_DELIVER_POLICY=new
COMPUTE_CONSUMER_RESET=false
NBBO_MAX_AGE_MS=1000
ROLLING_WINDOW_SIZE=50
ROLLING_TTL_SEC=86400
EQUITY_QUOTE_MAX_AGE_MS=1000
DARK_INFER_WINDOW_MS=60000
DARK_INFER_COOLDOWN_MS=30000
DARK_INFER_MIN_BLOCK_SIZE=2000
DARK_INFER_MIN_ACCUM_SIZE=3000
DARK_INFER_MIN_ACCUM_COUNT=4
DARK_INFER_MIN_PRINT_SIZE=200
DARK_INFER_MAX_EVIDENCE=20
DARK_INFER_MAX_SPREAD_PCT=0.005
CLASSIFIER_SWEEP_MIN_PREMIUM=40000
CLASSIFIER_SWEEP_MIN_COUNT=3
CLASSIFIER_SWEEP_MIN_PREMIUM_Z=2
CLASSIFIER_SPIKE_MIN_PREMIUM=20000
CLASSIFIER_SPIKE_MIN_SIZE=400
CLASSIFIER_SPIKE_MIN_PREMIUM_Z=2.5
CLASSIFIER_SPIKE_MIN_SIZE_Z=2
CLASSIFIER_Z_MIN_SAMPLES=12
CLASSIFIER_MIN_NBBO_COVERAGE=0.5
CLASSIFIER_MIN_AGGRESSOR_RATIO=0.55
CLASSIFIER_0DTE_MAX_ATM_PCT=0.01
CLASSIFIER_0DTE_MIN_PREMIUM=20000
CLASSIFIER_0DTE_MIN_SIZE=400

# Smart money refdata
SMART_MONEY_EVENT_CALENDAR_PATH=data/event-calendar.json
REFDATA_EVENT_CALENDAR_PATH=
REFDATA_EVENT_CALENDAR_PROVIDER=
ALPHA_VANTAGE_API_KEY=
ALPHA_VANTAGE_EARNINGS_HORIZON=3month
ALPHA_VANTAGE_EARNINGS_SYMBOL=
REFDATA_EVENT_CALENDAR_REFRESH_MS=86400000

# Candles
CANDLE_INTERVALS_MS=60000,300000
CANDLE_MAX_LATE_MS=0
CANDLE_CACHE_LIMIT=2000
CANDLE_DELIVER_POLICY=new
CANDLE_CONSUMER_RESET=false

# Replay profile
REPLAY_STREAMS=options,nbbo,equities,equity-quotes
REPLAY_START_TS=0
REPLAY_END_TS=0
REPLAY_SPEED=1
REPLAY_BATCH_SIZE=200
REPLAY_LOG_EVERY=1000
