CRYPTYX Docs
Portfolio Orchestration

Coinbase Integration

CRYPTYX x Coinbase — Autonomous Portfolio Manager

An autonomous portfolio manager that runs multiple strategies simultaneously, validates edges with walk-forward statistics, sizes positions with correlation-aware drawdown math, manages open positions as regimes evolve, and compounds its own alpha by persisting discovered edges as signals.

The 5-Phase Autonomous Loop

Phase 1: REVIEW ──────────────────────────────────────────────
  │  Check every open position
  │  Regime changed? → Close
  │  Stop hit? → Close
  │  Horizon expired? → Close
  │  +15% profit? → Take half
  │  Thesis intact? → Hold
  │
Phase 2: DISCOVER (10 strategies in parallel) ───────────────
  │  LONG: efficiency breakout, trend momentum, stealth
  │        accumulation, correlation divergence, put/call
  │        extreme, vol compression, capitulation reversal
  │  SHORT: trend exhaustion, distribution breakdown,
  │        funding squeeze
  │  Each: composite backtest → universe scan → regime filter
  │  Strategies that fail validation are skipped
  │
Phase 3: CORRELATE & SIZE ────────────────────────────────────
  │  Collect ALL candidates across ALL strategies
  │  Compute pairwise correlation via factor scores
  │  Penalize correlated positions (avoid concentration)
  │  7-component conviction score (0-100):
  │    backtest + regime + factors + signals
  │    + walk-forward bonus + correlation penalty + liquidity
  │  Drawdown-based sizing with correlation adjustment
  │
Phase 4: EXECUTE ─────────────────────────────────────────────
  │  Preview orders (check fees/slippage)
  │  Place orders with full conviction notes
  │  Max 5 positions, 25% each, 75% total deployed
  │
Phase 5: SIGNAL FACTORY (the compounding loop) ──────────────
     Find closest existing signal to today's winning strategy
     Fork it with discovered parameters
     Backtest the fork over 90 days
     If quality passes → ready for walk-forward validation
     Next cycle benefits from the richer signal catalog

Strategy Library (10 strategies)

The agent runs all 10 strategies in parallel during Phase 2. Each maps to a concrete set of metric conditions across different factor classes.

Long (7)

StrategyFactor ClassesThesisRegime
Efficiency BreakoutEFF + TRHigh price efficiency + trend accelerationTrending
Trend MomentumTR + FUTPrice above long MA + sustained positive fundingTrending
Stealth AccumulationFLOW + VOLNet buying pressure + suppressed volatilityAny
Correlation DivergenceCORR + EFFBTC decorrelation + independent efficiencyAny
Put/Call ExtremeOPT + VOLElevated put/call ratio + vol spike (BTC/ETH only)Mean-reverting
Volatility CompressionVOL + FLOWCompressed RV + accumulation flowAny
Capitulation ReversalVOL + FLOW + FUTVol spike + selling pressure + funding stressMean-reverting

Short (3)

StrategyFactor ClassesThesisRegime
Trend ExhaustionTR + EFFFar above MA + collapsing efficiencyVolatile
Distribution BreakdownFLOW + TRHeavy net selling + price below MATrending
Funding SqueezeFUT + VOLExtreme positive funding + elevated volatilityVolatile

Conviction Scoring (0-100, 7 components)

ComponentRange
Backtest quality0-30
Regime alignment0-20
Factor support0-15
Signal confirmation0-10
Walk-forward bonus0-15 (if matching signal passed IS/OOS validation)
Correlation penalty-20 to 0 (penalize if >0.7 correlated with existing position)
Liquidity bonus0-10

The correlation penalty is the key: it ensures the portfolio doesn't concentrate in correlated assets even if each individually scores well. Two 80-conviction assets that are 0.9 correlated is worse than one 80 and one 60 that are uncorrelated.

Signal Factory — The Compounding Loop

Cycle 1: Discover capitulation reversal edge on SUI
         Fork CORR_SPIKE_BTC_30D with discovered params
         Backtest: 12% trigger rate, 0.62 avg confidence
         → Signal proposed for validation

Cycle 2: Signal catalog now includes the forked signal
         Cross-check finds it confirming a vol compression setup
         → +15 conviction bonus from walk-forward validation
         → Higher conviction → bigger position → more alpha

Cycle N: Signal catalog has grown from 29 to 45+ signals
         Each was discovered by a previous cycle
         Each was statistically validated (paired t-test, bootstrap CI)
         The system is literally building its own intelligence

The compounding effect: Each cycle discovers edges → persists as signals → future cycles have richer cross-checking → higher conviction → better trades → discover more edges. This is a flywheel, not a one-shot.

Position Management (Regime-Adaptive)

Open positions are actively managed, not fire-and-forget:

ConditionActionExample
Stop-loss hitCloseEntry $85k, stop $69.7k, current $69.5k
Regime flippedCloseEntered on reversal, regime now trending
Horizon expiredClose30d hold target, day 31
+15% unrealizedTrim 50%Take profits, trail stop on remainder
-10% with >50% horizon leftTrim 50%Reduce exposure, preserve capital
Thesis intactHoldPnL within range, regime stable

Correlation-Aware Sizing

Raw size:    risk_budget / max_dd_p95
             (same as Kraken)

Correlation factor:
  corr > 0.85 with existing position → × 0.3
  corr > 0.70 → × 0.5
  corr > 0.50 → × 0.75
  corr < 0.50 → × 1.0

Deployment factor:
  > 60% already deployed → × 0.5
  > 40% deployed → × 0.75
  < 40% deployed → × 1.0

Final size = raw × correlation × deployment

Example: $100k portfolio, 40% deployed, candidate correlated 0.75 with existing BTC position:

  • Raw size: 1.5% / 8% = 18.75%
  • Correlation: × 0.5 = 9.375%
  • Deployment: × 0.75 = 7.03%
  • Final: $7,030

Strategy Scorecard

Representative backtests from the composite metric slicer. Asset selection reflects metric scope — CORR metrics require a comparison asset, OPT metrics are Deribit-scope (BTC and ETH).

Long

StrategyAssetSharpeHit RateEpisodesHorizonDD P95
Efficiency BreakoutBTC3.4777%10214d17.5%
Efficiency BreakoutETH2.5669%9114d25.2%
Trend MomentumBTC2.6865%5230d17.6%
Correlation DivergenceETH2.6255%921d8.9%

Short

StrategyAssetShort Win RateEpisodesHorizonDD P95
Distribution BreakdownBTC64%2830d29.8%

Backtests run against the CRYPTYX composite slicer API, April 2026, and independently validated. Full methodology — Sharpe calculation, horizon selection, episode independence, inclusion criteria — lives on the CRYPTYX methodology page. Strategies absent from the scorecard remain part of the agent's runtime library; they are excluded from the public view where episode counts or risk-adjusted returns at the best horizon fall outside the bar used for external publication.

Coverage across all 8 factor classes (CORR, EFF, FLOW, FUT, OB, OPT, TR, VOL), both directions, horizons from 1d to 365d.

Setup

cd integrations/coinbase
npm install

# Required
export ANTHROPIC_API_KEY="sk-ant-..."
export CRYPTYX_API_KEY="cx_..."

# Required for live mode only
export COINBASE_KEY_NAME="organizations/..."
export COINBASE_KEY_ID="..."
export COINBASE_PRIVATE_KEY="-----BEGIN EC PRIVATE KEY-----\n...\n-----END EC PRIVATE KEY-----"

# Demo mode (default)
npm run demo

# Live mode
npm run trade:live

File Structure

integrations/coinbase/
├── types.ts               # Portfolio manager types (multi-strategy, correlation, validation)
├── coinbase-symbols.ts    # CRYPTYX ↔ Coinbase pair mapping (BTC-USD format)
├── coinbase-auth.ts       # JWT ES256 signing + REST client
├── portfolio-manager.ts   # Multi-strategy orchestrator + correlation sizing + position review
├── signal-factory.ts      # Fork → backtest → validate → persist loop
├── conviction-trader.ts   # 5-phase autonomous agentic loop (27 tools)
├── test-strategies.ts     # Backtest all strategies against real data
├── package.json           # Standalone npm project
├── claude-desktop-config.json
└── README.md              # This file

Technical Notes

Coinbase Auth (JWT ES256)

Coinbase uses short-lived JWTs (2-minute expiry) signed with ECDSA ES256 using an EC private key. Each request generates a fresh JWT — more secure but operationally complex for long-running agents.

Why 10 Strategies Simultaneously

The market doesn't present one clean thesis. On any given day:

  • Efficiency Breakout might find 5 trending assets (EFF + TR)
  • Trend Momentum might find 3 assets with structural funding (TR + FUT)
  • Trend Exhaustion might find 1 short candidate (overextended + decaying efficiency)
  • Put/Call Extreme might find BTC or ETH at a fear peak (OPT + VOL)
  • Correlation Divergence might find 3 decorrelated movers (CORR + EFF)
  • The other 5 strategies might find 0

Running 10 strategies (7 long + 3 short) across all 8 factor classes maximizes the opportunity surface. The correlation check prevents concentration even when multiple strategies identify the same asset. Every strategy has been backtested — no theoretical setups, only validated edges.

Walk-Forward Validation

The validation service uses paired t-tests and bootstrap CIs with a 70/30 IS/OOS split to test whether a signal's edge persists out-of-sample. This is the standard institutional approach to preventing overfitting — and it's built into the conviction score as a bonus, not just a gate. Signals that pass validation get +15 conviction points.