{"name":"ledger-api","version":1,"engine":{"ok":true,"missing":[]},"auth":{"full":"Bearer AUTH_TOKEN — everything","read":"not configured","cors":"disabled"},"filters":"market, wallet, coin, dir, status=open|closed|all, outcome=win|loss|be, tag, q, from, to (ms or seconds epoch, ISO time, or YYYY-MM-DD = that whole day on the tz clock, to inclusive; compared with closeTime, which for an open trade is its last fill — same semantics as the app), tz=utc|local","endpoints":[{"method":"GET","path":"/api/v1","auth":"none","desc":"this index"},{"method":"POST","path":"/api/v1/refresh","auth":"full","desc":"fetch fills/funding/positions from Hyperliquid into server caches; body {wallets?,full?,force?}; min interval 15s unless force"},{"method":"GET","path":"/api/v1/meta","auth":"read","desc":"freshness, wallet cache state, engine status, trade counts"},{"method":"GET","path":"/api/v1/trades","auth":"read","desc":"trade list; filters (market, wallet, coin, dir, status=open|closed|all, outcome=win|loss|be, tag, q, from, to (ms or seconds epoch, ISO time, or YYYY-MM-DD = that whole day on the tz clock, to inclusive; compared with closeTime, which for an open trade is its last fill — same semantics as the app), tz=utc|local) + sort, order, limit (<=1000), offset, events=1"},{"method":"GET","path":"/api/v1/trades/:id","auth":"read","desc":"one trade with fill events and journal entry"},{"method":"GET","path":"/api/v1/stats","auth":"read","desc":"computeStats over the filtered set; filters as above"},{"method":"GET","path":"/api/v1/equity","auth":"read","desc":"cumulative equity points, daily series, drawdown diagnostics; filters"},{"method":"GET","path":"/api/v1/calendar","auth":"read","desc":"net PnL per calendar day (tz-aware); filters"},{"method":"GET","path":"/api/v1/breakdown","auth":"read","desc":"grouped stats + per-group contribution shares; by=coin|dir|market|wallet|tag|dow|hour; basis=usd|pct ranks by dollars or summed return points; top=N (default 5) sizes the best/worst lists; filters"},{"method":"GET","path":"/api/v1/projection","auth":"read","desc":"Monte Carlo forward sim; horizon (days, default 90), paths (<=2000, default 400), block, seed, lookback (days); filters"},{"method":"GET","path":"/api/v1/kelly","auth":"read","desc":"Kelly sizing from filtered closed trades"},{"method":"GET","path":"/api/v1/capital","auth":"read","desc":"capital flows (deposits/withdrawals/transfers) + time-weighted return-on-capital model and money-weighted xirr; account-wide — ignores filters; wallet= optional"},{"method":"GET","path":"/api/v1/cache/:addr","auth":"full","desc":"one wallet's server caches (fills, funding, capital flows) as JSON, gzipped when accepted — how a new device seeds its browser caches"},{"method":"DELETE","path":"/api/v1/cache/:addr","auth":"full","desc":"evict one wallet's server caches (fills/funding/ledger) — cleans up body.wallets experiments and removed wallets"},{"method":"GET","path":"/api/v1/walkforward","auth":"read","desc":"rolling walk-forward expectancy (trailing train / out-of-sample test blocks) vs in-sample; train, step, seed; filters"},{"method":"GET","path":"/api/v1/risk","auth":"read","desc":"open-position risk model over last refreshed positions"},{"method":"GET","path":"/api/v1/positions","auth":"read","desc":"cached positions/spot/account snapshot; ?live=1 (full auth) refetches"},{"method":"GET","path":"/api/v1/spot/lots","auth":"read","desc":"FIFO 8949-style spot cost-basis lots; wallet= optional"},{"method":"GET","path":"/api/v1/whatif","auth":"read","desc":"counterfactual replay removing trades matching field/op/value (op: eq|ne|lt|lte|gt|gte|in); filters"},{"method":"GET","path":"/api/v1/digests","auth":"read","desc":"stored weekly digests (newest first); /api/v1/digests/YYYY-MM-DD fetches one. Written automatically when REFRESH_INTERVAL_MIN is set"},{"method":"GET","path":"/api/v1/journal","auth":"read","desc":"journal entries keyed by trade id (read-only)"},{"method":"GET","path":"/api/v1/journal/:id","auth":"read","desc":"one journal entry (read-only)"},{"method":"GET","path":"/api/v1/tags","auth":"read","desc":"distinct journal tags with usage counts"},{"method":"GET","path":"/api/v1/export/trades.csv","auth":"read","desc":"flat CSV of the filtered trades; filters"},{"method":"GET","path":"/api/v1/metrics","auth":"read","desc":"flat monitoring numbers (trades, PnL today/total, drawdown, exposure, account value); ?format=prom for Prometheus text"}]}