Skip to main content
GET
Get Models

Overview

The getModels endpoint returns a list of all trading models currently configured in the system. Each model represents an AI trading agent with its own unique identifier and display name.

Model Variants

Each model in the system belongs to a specific variant that defines its trading strategy:
  • Apex - Aggressive 10x leverage with Kelly engine, VWAP momentum validation, squeeze trading
  • Trendsurfer - Trend follower with ADX > 25 filter and Kijun-Sen trailing stops
  • Contrarian - Mean reversion strategy for ranging markets (ADX < 25), fade to VWAP
  • Sovereign - Flexible regime-adaptive allocator blending trend & range strategies
While variants are stored in the database schema, the basic getModels endpoint returns only id and name fields for lightweight model listing.

Request

object
Empty object - no parameters required

Response

array
Array of model objects with basic identification fields
string
Optional warning message if fallback data is being used (e.g., “Database unavailable, using static model metadata.”)

Database Schema

The full Models table includes additional fields not exposed by this endpoint:

Fallback Behavior

If the database is unavailable, the endpoint returns a static fallback list derived from MODEL_INFO configuration:
The response will include a warning field when fallback data is being served.

TanStack Query Integration

Client Usage

Query Configuration

Example Response

Error Handling

The endpoint includes Sentry error tracking and graceful fallback:

Implementation Details

Source Files:
  • Router: src/server/orpc/router/models.ts:18-41
  • Query Function: src/server/features/trading/queries.server.ts:696-703
  • Schema: src/db/schema.ts:29-48
Cache Strategy:
  • Stale Time: 30 seconds (models rarely change)
  • GC Time: 5 minutes
  • Refetch: On window focus (default TanStack behavior)