Skip to main content
POST
/
api
/
rpc
/
variants.getVariants
Get Variants
curl --request POST \
  --url https://api.example.com/api/rpc/variants.getVariants
{
  "variants": [
    {
      "id": {},
      "label": "<string>",
      "description": "<string>",
      "temperature": 123,
      "color": "<string>"
    }
  ]
}

Overview

Returns the complete list of available trading strategy variants, including their IDs, labels, descriptions, temperature settings, and UI colors. This endpoint provides the single source of truth for all variant definitions in the system.

Request

Input Schema

{
  // No input parameters required
}
This endpoint does not require any input parameters and returns all available variants.

Response

Output Schema

variants
array
required
Array of variant configuration objects

Example Response

{
  "variants": [
    {
      "id": "Apex",
      "label": "Apex (Kelly Engine)",
      "description": "Aggressive 10x leverage, VWAP momentum validation, squeeze trading",
      "temperature": 0.7,
      "color": "#a855f7"
    },
    {
      "id": "Trendsurfer",
      "label": "Trendsurfer (Momentum)",
      "description": "Trend follower, ADX > 25 filter, Kijun-Sen trailing stops",
      "temperature": 0.5,
      "color": "#06b6d4"
    },
    {
      "id": "Contrarian",
      "label": "Contrarian (Reverter)",
      "description": "Mean reversion in ranging markets, ADX < 25, fade to VWAP",
      "temperature": 0.6,
      "color": "#e11d48"
    },
    {
      "id": "Sovereign",
      "label": "Sovereign (Adaptive)",
      "description": "Flexible regime-adaptive allocator, blends trend & range strategies",
      "temperature": 0.8,
      "color": "#eab308"
    }
  ]
}

Variant Definitions

The system currently supports four trading strategy variants:
Strategy: Aggressive momentum trader using 10x leverageKey Features:
  • VWAP momentum validation
  • Squeeze trading patterns
  • Kelly criterion for position sizing
  • High risk/reward ratio
Color: Purple (#a855f7)
Strategy: Classic trend following approachKey Features:
  • ADX > 25 filter for strong trends
  • Kijun-Sen trailing stops
  • Momentum indicators
  • Medium risk profile
Color: Cyan (#06b6d4)
Strategy: Mean reversion in ranging marketsKey Features:
  • ADX < 25 filter for range-bound conditions
  • Fade to VWAP strategy
  • Overbought/oversold signals
  • Counter-trend entries
Color: Rose (#e11d48)
Strategy: Regime-adaptive hybrid approachKey Features:
  • Blends trend and range strategies
  • Dynamic allocation based on market conditions
  • Higher temperature for creative decision-making
  • Flexible risk management
Color: Yellow (#eab308)

Usage

import { useQuery } from "@tanstack/react-query";
import { orpc } from "@/server/orpc/client";

function VariantsList() {
  const { data, isLoading, error } = useQuery(
    orpc.variants.getVariants.queryOptions({ input: {} })
  );

  if (isLoading) return <div>Loading variants...</div>;
  if (error) return <div>Error: {error.message}</div>;

  return (
    <div className="space-y-4">
      {data.variants.map((variant) => (
        <div
          key={variant.id}
          className="p-4 border rounded-lg"
          style={{ borderColor: variant.color }}
        >
          <h3 className="font-semibold">{variant.label}</h3>
          <p className="text-sm text-muted-foreground">
            {variant.description}
          </p>
          <div className="mt-2 flex items-center gap-4 text-xs">
            <span>Temperature: {variant.temperature}</span>
            <span
              className="w-4 h-4 rounded"
              style={{ backgroundColor: variant.color }}
            />
          </div>
        </div>
      ))}
    </div>
  );
}

Implementation Details

Data Source

Variants are defined in the shared configuration module at src/core/shared/variants/index.ts:
// Single source of truth for variant definitions
export const VARIANT_IDS = [
  "Apex",
  "Trendsurfer",
  "Contrarian",
  "Sovereign",
] as const;

export const VARIANT_CONFIG: Record<VariantId, VariantConfig> = {
  Apex: {
    label: "Apex (Kelly Engine)",
    description: "Aggressive 10x leverage...",
    color: "#a855f7",
    // ...
  },
  // ...
};

Temperature Settings

The temperature values are retrieved from the prompt configuration (VARIANT_PROMPTS) which defines the AI model behavior for each variant:
  • Lower temperature (0.5): More consistent, deterministic decisions
  • Higher temperature (0.8): More creative, exploratory trading

Performance

  • Cached: This endpoint returns static configuration and can be safely cached
  • Response time: < 10ms (in-memory data)
  • Monitoring: Tracked via Sentry span variants.getVariants

Get Variant Stats

View aggregated performance statistics for each variant

Get Variant History

Retrieve historical portfolio data per variant

Notes

The variant list is static and defined at compile time. Adding new variants requires:
  1. Updating VARIANT_IDS and VARIANT_CONFIG in the shared module
  2. Creating corresponding prompt configurations
  3. Running database migrations to update the enum
Use the id field as the primary key for filtering and referencing variants throughout the application. The label is for display purposes only.

Build docs developers (and LLMs) love