CRYPTYX Docs
Edge Discovery

OKX Integration

CRYPTYX × OKX Integration

Metric-driven conviction trading: CRYPTYX intelligence → AI-defined strategies → OKX execution.

The Core Capability

CRYPTYX provides the intelligence layer for OKX execution — not pre-computed signals, but a composable framework for agents to build and validate their own strategies:

The Metric Slicer lets an AI agent build and validate its own trading strategies from 376 raw metrics.

Agent: "I want to find assets where funding rate stress is extreme
        AND realized volatility is compressing."

CRYPTYX: Here are 376 metrics across 8 factor classes. Define your conditions:
         → FUT_FR_MEAN_1D z-score > 2.0  (funding stress)
         → VOL_REALIZED_7D z-score < -1.5 (vol compression)

         Backtesting this composite on BTC:
         → Historical episodes matched, forward returns at 8 horizons
         → Sharpe, hit rate, and drawdown stats per horizon

         Scanning 200+ assets today:
         → Assets matching both conditions surfaced with z-scores

Agent: "High conviction. Execute BTC long, 20% of portfolio, via OKX."

This is the loop: Discover → Define → Validate → Scan → Execute.

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                          AI Agent                               │
│                                                                 │
│  The agent DEFINES its own strategy from raw metrics.           │
│  Not consuming pre-built signals — building new ones.           │
│                                                                 │
├──────────────────────┬──────────────────────────────────────────┤
│   CRYPTYX MCP        │           OKX agent-trade-kit            │
│   (Intelligence)     │           (Execution)                    │
│                      │                                          │
│  ┌────────────────┐  │  ┌────────────────┐  ┌───────────────┐  │
│  │ Metric Slicer  │  │  │ Spot Trading   │  │ Swap Trading  │  │
│  │ (hero feature) │  │  │ (13 tools)     │  │ (17 tools)    │  │
│  │ • analyze      │  │  ├────────────────┤  ├───────────────┤  │
│  │ • composite    │  │  │ Futures        │  │ Options       │  │
│  │ • scan         │  │  │ (6 tools)      │  │ (10 tools)    │  │
│  │ • featured     │  │  ├────────────────┤  ├───────────────┤  │
│  ├────────────────┤  │  │ Account        │  │ Trading Bots  │  │
│  │ Research Lab   │  │  │ (14 tools)     │  │ (10 tools)    │  │
│  │ • IC rankings  │  │  ├────────────────┤  └───────────────┘  │
│  │ • metric eval  │  │  │ Market Data    │                     │
│  ├────────────────┤  │  │ (12 tools)     │                     │
│  │ Signal Forge   │  │  └────────────────┘                     │
│  │ • backtest     │  │                                          │
│  │ • fork         │  │  Full execution surface                 │
│  │ • simulate     │  │  via OKX agent-trade-kit                 │
│  ├────────────────┤  │                                          │
│  │ Market Context │  │                                          │
│  │ • composite    │  │                                          │
│  │ • regime       │  │                                          │
│  │ • factor scores│  │                                          │
│  └────────────────┘  │                                          │
│                      │                                          │
│  21 intelligence     │  Execution layer                         │
│  tools               │                                          │
│  376 raw metrics     │                                          │
└──────────────────────┴──────────────────────────────────────────┘

Layered Intelligence Stack

The metric slicer is the entry point, but CRYPTYX intelligence is layered. An agent can cross-check at every level to build or break conviction:

Layer 1: Metric Slicer (atomic)       ← HERO — define & backtest theses
  │       376 raw z-scores, multi-factor intersection, universe scan
  │
Layer 2: Factor Scores (class)        ← does the class-level picture support the thesis?
  │       8-class t-scores (TR, VOL, FLOW, FUT, OB, OPT, CORR, EFF)
  │
Layer 3: Composite Rankings (asset)   ← is this asset ranked highly overall?
  │       Weighted blend across all factors
  │
Layer 4: Signals (event)              ← are discrete signals confirming?
  │       Triggers with confidence scores, backtest over date ranges
  │
Layer 5: Regime (macro)               ← don't fight the trend
          Market regime classification with confidence

More layers agreeing = higher conviction. An agent that finds a metric slicer thesis, confirms it with factor scores, sees the asset ranked highly in composite, has two signals firing, and regime is favorable — that's a full-stack conviction bet.

The architecture is designed to grow over time. As new metrics, signals, and factor classes are added, agents automatically gain access to richer cross-checking. A thesis that uses 3 layers today can use 5 layers tomorrow without reconfiguration.

The 6-Step Loop

Step 1: DISCOVER

get_featured_metrics → Research Lab ranks all 376 metrics by information coefficient (IC). Which metrics actually predict forward returns? Start here.

Step 2: DEFINE

analyze_metrics_composite → Build a trading thesis from 2-4 metric conditions across different factor classes. Example: "funding stress AND vol compression AND trend momentum."

Step 3: VALIDATE (horizon-aware)

The composite slicer backtests your thesis against historical data. Returns forward returns at 8 horizons (1d, 3d, 7d, 14d, 30d, 60d, 90d, 365d), episode count, and hit rates.

The horizon data drives holding period. The same thesis may produce its best risk-adjusted return at a short horizon (swing trade), at a medium horizon (macro position), or not at all — an agent targeting short-term positions needs the 7d and 14d rows to validate; a macro agent needs 30d and 60d. The backtest tells you where the edge actually lives instead of forcing a one-size holding period.

Step 4: SCAN

scan_metric_universe → Check which of 200+ assets match your conditions TODAY. Assets appearing in multiple scans simultaneously are "fat pitches" — rare multi-factor convergence events.

Step 5: STORE

fork_signal → Once a thesis validates, persist it as a custom signal. The daily pipeline automatically evaluates it across all assets every day. When conditions trigger again, the agent gets notified.

This is the compounding loop: discover edge → validate → persist → auto-alert → execute. The agent builds up a library of validated strategies over time. Each stored strategy is one more lens the system watches through daily.

Step 6: EXECUTE

Feed qualifying assets to OKX with conviction-weighted sizing. Holding period matches the validated horizon. More conditions met = higher conviction = larger position.

Setup

1. Install both MCP servers

# CRYPTYX intelligence
npm install -g @cryptyx/mcp-server

# OKX execution
npm install -g @okx_ai/okx-trade-mcp @okx_ai/okx-trade-cli

2. Configure OKX credentials

okx config init
# Follow prompts: API key, secret key, passphrase
# Use demo mode for testing (virtual funds)

3. Configure Claude Desktop

Copy claude-desktop-config.json to your Claude Desktop config directory:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "cryptyx": {
      "command": "npx",
      "args": ["@cryptyx/mcp-server"],
      "env": {
        "CRYPTYX_API_KEY": "your-cryptyx-api-key"
      }
    },
    "okx-trade": {
      "command": "okx-trade-mcp",
      "env": {
        "OKX_API_KEY": "your-okx-api-key",
        "OKX_SECRET_KEY": "your-okx-secret-key",
        "OKX_PASSPHRASE": "your-okx-passphrase"
      }
    }
  }
}

4. Or configure Claude Code

claude mcp add cryptyx -- npx @cryptyx/mcp-server
claude mcp add okx-trade -- okx-trade-mcp

Usage

Interactive (Claude Desktop / Claude Code)

With both MCPs configured, prompt the agent:

"Use CRYPTYX to find the top-performing metrics by IC. Then build a multi-factor thesis combining funding stress with volatility compression. Backtest it on BTC. If it validates with >55% hit rate, scan the universe for matches and execute on OKX in demo mode."

The agent will call the metric slicer tools to discover, define, validate, scan, and execute — the full loop.

Standalone Analyzer (analyze-convictions.ts)

No MCP or Claude API required — calls the CRYPTYX REST API directly and demonstrates the metric slicer loop.

cd integrations/okx && npm install

# Full loop: discover → define → validate → scan
CRYPTYX_API_KEY=your-key npm run analyze

# Scan only (skip backtest)
CRYPTYX_API_KEY=your-key npx tsx analyze-convictions.ts --scan-only

# Target a specific asset for backtesting
CRYPTYX_API_KEY=your-key npx tsx analyze-convictions.ts --asset ETH

AI-Powered Trader (conviction-trader.ts)

A multi-step reasoning loop: the agent calls CRYPTYX intelligence tools via the REST API to build and validate trading theses. Each tool call hits the live CRYPTYX API — this is not a simulation.

# Analyze only (dry run) — the agent discovers, defines, validates, scans
ANTHROPIC_API_KEY=your-key CRYPTYX_API_KEY=your-key npm run demo

# Execute with virtual funds (adds OKX execution recommendations)
ANTHROPIC_API_KEY=your-key CRYPTYX_API_KEY=your-key npm run trade:demo

CRYPTYX Tools — Ordered by Impact

The CRYPTYX MCP server exposes 21 intelligence tools. The tables below highlight the tools most relevant to the OKX integration loop. For the full catalog, see the Kraken integration.

Metric Slicer (hero features — unique to CRYPTYX)

ToolWhat it does
get_featured_metricsTop metrics ranked by IC — start here
analyze_metrics_compositeMulti-factor backtest: 2-4 conditions → forward returns at 8 horizons
analyze_metricSingle-metric deep dive with z-score thresholds
scan_metric_universeScan 200+ assets for z-score extremes today

Signal Forge + Strategy Persistence

ToolWhat it does
fork_signalStore a validated thesis as a custom signal — daily pipeline auto-evaluates
backtest_signalRun a stored signal over a date range with per-day trigger stats
simulate_signalEstimate trigger rates for proposed threshold changes
get_signal_catalogFull catalog with active parameters and 30-day stats
get_signal_triggersToday's active signal firings with confidence

Market Context

ToolWhat it does
get_composite_rankingsPre-computed asset rankings across all factors
get_factor_scoresClass-level t-scores (8 classes × multiple horizons)
get_market_pulseFactor breadth and regime analysis
get_regime_analysisAsset regime classification with confidence
get_market_snapshotCurrent prices, returns, composite scores
get_asset_liquidityOrder book depth at 50/100/200bp

OKX Execution Tools Used

ToolPurpose
spot_place_orderExecute spot buy/sell
swap_place_orderExecute perpetual swap
get_account_balanceCheck available funds
get_tickerCurrent price for limit order calc

Example Theses

The demo includes three pre-built trading theses showing different factor class combinations:

Flow Accumulation + Vol Compression

FLOW_TAKER_NET_USD_SUM_7D z > 1.5 AND VOL_RV_60D z < -1.0
→ Breakout setup: strong net taker flow + low realized volatility

Trend Momentum + Funding Accumulation

TR_MA_DIST_180D z > 1.0 AND FUT_FR_ACCUM_30D z > 1.0
→ Trend continuation: price above long-term MA + sustained funding rate

Efficiency Regime + Correlation Shift

EFF_ER_30D z > 1.0 AND CORR_ETH_30D z < -1.0
→ Independent momentum: high price efficiency + ETH decorrelation

An AI agent isn't limited to these — it can build any thesis from the full 376-metric catalog.

Example Output

A representative run of the conviction pipeline against BTC:

━━ Step 1: DISCOVER — Top Metrics by Information Coefficient ━━

  Hero metric: CORR_ETH_90D (CORR)
    IC: 0.1144 | Hit Rate: 57.0%

  Top performers:
    CORR_ETH_90D                        CORR   IC:  0.1144 Hit: 57.0%
    TR_RET_365D                         TR     IC:  0.0975 Hit: 64.6%
    CORR_ETH_30D                        CORR   IC:  0.0781 Hit: 52.1%
    FUT_OI_ROC_1D                       FUT    IC:  0.0714 Hit: 56.6%
    FUT_FUNDING_MA_365D                 FUT    IC:  0.0458 Hit: 67.2%
    VOL_RV_30D                          VOL    IC:  0.0382 Hit: 55.4%

━━ Step 2: DEFINE — Multi-Factor Trading Theses ━━

  "Trend Momentum + Funding Accumulation"
    Price above long-term MA + sustained funding rate → trend continuation
    → TR_MA_DIST_180D gt 1.0
    → FUT_FR_ACCUM_30D gt 1.0

━━ Step 3: VALIDATE — Horizon-Aware Backtest ━━

  Testing: "Trend Momentum + Funding Accumulation" on BTC...
    Episodes: 52
    1d     avg: +0.35% | hit rate: 55.8% | sharpe: 2.52
    7d     avg: +2.04% | hit rate: 61.5% | sharpe: 2.32
    14d    avg: +5.05% | hit rate: 73.1% | sharpe: 2.61
    30d    avg: +11.13% | hit rate: 65.4% | sharpe: 2.68
    60d    avg: +14.74% | hit rate: 78.8% | sharpe: 2.26
    90d    avg: +9.46% | hit rate: 59.6% | sharpe: 0.85

    → Risk-adjusted best: 30d (sharpe 2.68)

━━ Step 4: SCAN — Universe Scan for Z-Score Extremes ━━

  Scanning: Flow Accumulation (FLOW_TAKER_NET_USD_SUM_7D gt 1.5)...
    3 assets match:
      WAL      z: 2.01
      FIL      z: 1.57
      SAND     z: 1.50

  Scanning: Above Long-Term MA (TR_MA_DIST_180D gt 1.0)...
    14 assets match:
      DEXE     z: 5.21
      JST      z: 2.38
      VANA     z: 2.19
      LEO      z: 2.10
      AKT      z: 1.81
      ... and 9 more

Output generated from CRYPTYX live API, April 2026. Sharpe calculation, horizon selection, and episode independence are documented on the CRYPTYX methodology page.