Overview
Theanalytics.getRunInfo endpoint provides information about the current trading session, including when trading began. This is useful for calculating session duration, determining data availability, and contextualizing performance metrics.
Endpoint
Input Parameters
This endpoint takes no input parameters.Response Schema
Date | null
The timestamp when trading began, determined by the earliest portfolio snapshot.Returns
null if no portfolio snapshots exist (trading has not started).How Run Start Time is Determined
The run start time is calculated by finding the earliest portfolio snapshot in the database:- Uses the
portfolioSizetable, which tracks portfolio values over time - Finds the earliest
createdAttimestamp - Returns
nullif the table is empty (no trading activity yet) - Does not distinguish between live trading and simulator modes
Use Cases
Calculate Session Duration
Determine how long the trading session has been running:Contextualize Performance Metrics
Provide context for Sharpe ratio and other time-sensitive metrics:Determine Data Availability
Check if historical data is available for analysis:Usage Examples
Display Session Uptime
Calculate Session Statistics
Conditional Rendering Based on Data Availability
Session Reliability Warning
Combine with Leaderboard for Context
Implementation Notes
Why Portfolio Snapshots?
The endpoint uses portfolio snapshots rather than other timestamps (like first order or first model creation) because:- Portfolio snapshots are consistent: They’re created regularly by the system
- Meaningful start time: Trading effectively begins when portfolio tracking starts
- Available for both modes: Works in both live trading and simulator modes
- Database reliability: The
portfolioSizetable is a stable source of truth
Null Handling
The endpoint returnsnull instead of throwing an error when no data exists. This allows:
- Graceful handling in UI components
- Conditional rendering based on data availability
- Clear distinction between “no data” and “error”
Time Zones
The returnedDate object is in UTC. Convert to local time in your UI:
Source Code Reference
Implementation details:- Router:
src/server/orpc/router/analytics.ts:243-250 - Query function:
src/server/features/analytics/queries.server.ts:666-674 - Database schema:
src/db/schema.ts(portfolioSize table)
Related Endpoints
- Get Model Stats - Performance metrics that depend on session duration
- Get Leaderboard - Time-windowed rankings
- Get Portfolio History - Historical portfolio values

