Skip to main content

Platform APIs

HyperionX has several API layers. Some exist today inside the desktop runtime. Others are planned public or local APIs for agents, external tools, and developer workflows.

API Layers

API LayerStatusPurpose
Code Lab Runtime APICurrentIn-process C# indicators, strategies, bar types, optimizers, commissions, money management modules, and addons.
Provider API LayerCurrentMaps broker/exchange/simulation/playback providers into HyperionX instruments, candles, accounts, orders, and positions.
Chart AI Context APICurrentRead-only chart snapshot used by the in-app AI assistant.
Local Agent HTTP APIPlannedLocalhost API for external agents and CLI tools.
CLI APIPlannedTerminal-friendly wrapper around local APIs and Code Lab diagnostics.
Permissioned Action APIPlannedControlled tools for simulation and eventually live actions with confirmation and audit logging.

Code Lab Runtime API

Current Code Lab scripts run in-process and use HyperionX assemblies:

  • HyperionX.Core.dll
  • HyperionX.Chart.dll
  • HyperionX.Model.dll
  • HyperionX.DB.dll
  • HyperionX.SDK.dll

Primary script base areas:

  • HyperionX.Core.DataCalc.ScriptBase
  • HyperionX.Core.DataCalc.IndicatorBase
  • HyperionX.Core.DataCalc.StrategyBase
  • HyperionX.Core.DataCalc.Draw

Public script authors should use the generated Indicator and Strategy base classes in the HyperionX.Custom namespaces rather than deriving directly from lower-level internal classes.

Provider API Layer

Providers translate external systems into the HyperionX model.

Provider adapters should map:

  • Connection state.
  • Instrument metadata.
  • Historical data.
  • Live market data.
  • Market depth where available.
  • Account balances.
  • Orders.
  • Order states.
  • Positions.
  • Executions.
  • Leverage and margin settings where supported.

Provider adapters should not leak provider-specific implementation details into chart UI or Code Lab unless the feature is intentionally exposed.

Chart AI Context API

Current status: implemented in-app, read-only.

The chart AI context exposes safe chart state:

  • Candles.
  • Visible candles.
  • Indicator metadata.
  • Strategy metadata.
  • Chart Trader state.

It intentionally does not expose:

  • Credentials.
  • API keys.
  • Wallet keys.
  • Raw filesystem access.
  • Direct order submission.

Planned Local Agent API

The local agent API should expose chart and Code Lab context over localhost.

Recommended base path:

http://127.0.0.1:{dynamicPort}/api/hyperionx/v1

Recommended rules:

  • Bind to localhost only.
  • Require a per-session token.
  • Read-only by default.
  • Redact secret-like values.
  • Include build/version metadata.
  • Keep live trading disabled unless explicitly enabled.

Planned Read Endpoints

GET /health
GET /version
GET /charts
GET /charts/active
GET /charts/{chartId}
GET /charts/{chartId}/snapshot?bars=120
GET /charts/{chartId}/visible
GET /charts/{chartId}/last-candle
GET /charts/{chartId}/indicators
GET /charts/{chartId}/strategies
GET /charts/{chartId}/chart-trader
GET /connections
GET /accounts
GET /workspace

Planned Code Lab Endpoints

GET /codelab/scripts
POST /codelab/validate
POST /codelab/build
GET /codelab/diagnostics
GET /codelab/templates/indicator
GET /codelab/templates/strategy

These endpoints should support agent workflows without requiring an agent to scrape UI controls.

Planned CLI

A CLI can wrap the same local APIs.

Example future commands:

hx chart list
hx chart active --json
hx chart snapshot --chart active --bars 120 --json
hx chart visible --chart active --json
hx codelab build
hx codelab validate-script ./MyIndicator.cs
hx workspace status

JSON output should be the default for agent workflows. Human-readable output can be optional.

Permissioned Action APIs

Action APIs should be staged by risk.

StageExampleRule
Read-onlyChart snapshotAllowed with token.
DiagnosticsCode Lab buildAllowed with token and workspace permission.
DraftPrepare order ticketDoes not submit order.
SimulationSubmit sim orderRequires simulation mode permission.
LiveSubmit live orderRequires explicit enablement, confirmation, risk limits, and audit log.

Compatibility Rules

Public APIs should avoid private UI objects and fragile implementation details.

Stable public direction:

  • Code Lab scripts through documented C# namespaces.
  • Read-only chart snapshots through local agent APIs.
  • Provider data through HyperionX provider abstractions.
  • Trading actions only through permissioned, audited tools.
  • Versioned API contracts so agents can check compatibility.