Forex Execution
Forex Execution is a TypeScript/Fastify OANDA REST-v20 execution service. It lives as a
package folder inside the parent trading-algos repository (not a nested Git repo). Docker is
intentionally excluded — the service is expected to run with pm2.
Phase scope (Phases 1–2 only). This implementation covers project bootstrap, validated configuration, practice/live URL resolution, an authenticated OANDA client, normalized broker errors, protected internal HTTP routing, health endpoints, normalized account/instrument APIs, account snapshot persistence, and instrument metadata persistence. Order placement is not implemented in this phase. Do not treat this service as a live trade executor yet.
What Phases 1–2 deliver
- Validated
.envconfiguration with practice/live OANDA URL resolution - Authenticated OANDA REST client and normalized broker errors
- Internal HTTP API gated by
X-Internal-API-Key - Liveness / readiness health checks
- Normalized account summary, details, instruments, snapshots, and account changes
- Persistence for account snapshots and instrument metadata
Explore the docs
Copy .env, install, run with npm run dev, and hit the health endpoints.
Real src/ layout — config, OANDA client, routes, persistence, and common utilities.
Health and account endpoints, plus the internal API key requirement.
API ReferenceDual live gate (OANDA_ENV + LIVE_TRADING_ENABLED) and environment variables.
npm scripts for dev, build, typecheck, lint, and tests.
Scripts