# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Project Overview A TypeScript trading bot that monitors the TQQQ ETF via the Alpaca paper trading API. It waits for market open, samples two price quotes one second apart, and logs whether the price moved up or down. It runs in a continuous hourly loop. ## Commands - **Build:** `npm run build` (compiles TypeScript from `src/` to `dist/`) - **Start:** `npm start` (runs compiled `dist/index.js`) - **Dev:** `npm run dev` (runs with ts-node + nodemon for auto-reload) - **Docker:** Standard `docker build` / `docker run` using the included Dockerfile (Node 22 base) There are no tests or linting configured. ## Architecture Two source files with a simple layered design: - `src/index.ts` — Entry point. Contains the main loop (`main()` → `runDay()`) that waits for market open via the Alpaca clock API, fetches two consecutive TQQQ quotes, compares them, and logs the direction. Utility functions for account balance, asset info, and delays live here too. - `src/alpaca.ts` — Wrapper class around `@alpacahq/alpaca-trade-api`. Exposes methods for account info, asset lookup, market clock, and price quotes. Uses CommonJS `require` for the Alpaca SDK (not ES import). ## Build Configuration - **TypeScript target:** ES2016, CommonJS modules, strict mode enabled - **Source/output dirs:** `src/` → `dist/` - `esModuleInterop` is on — mixed import styles are allowed