Getting Started
Prerequisites: Node.js (for npm), an OANDA practice account ID and API token. Run Git commands
from the parent trading-algos repository root — this package is not a nested Git repo.
Copy env and install
cd forex-execution
cp .env.example .env
npm installPopulate .env
At minimum set:
| Variable | Notes |
|---|---|
OANDA_ACCOUNT_ID | Practice account ID |
OANDA_API_TOKEN | Practice API token |
INTERNAL_API_KEY | Min 16 characters; required on non-health routes |
DATABASE_URL | PostgreSQL connection string |
REDIS_URL | Redis connection string |
Defaults keep you on practice: OANDA_ENV=practice. Live startup is rejected unless both
OANDA_ENV=live and LIVE_TRADING_ENABLED=true are set — see
Configuration.
Run the service
npm run devThis runs with tsx watch and loads .env.
Docker setup is intentionally excluded. Run the service with pm2 in production.
Verify
GET /health/live— livenessGET /health/ready— configuration, OANDA authentication, and instrument metadata smoke test
Account routes require X-Internal-API-Key. Full contract:
API Reference.
Next steps
- Architecture —
src/layout - Configuration — dual live gate and env vars
- Scripts — npm commands
Last updated on