Skip to main content

Strategy

No description

type Strategy implements Node {
backtestStats: BacktestStats
runningBacktestCount: Int!
analysis: StrategyAnalysis
encryptionStatus: EncryptionStatus!
id: ID!
public: Boolean!
featured: Boolean!
deletedAt: Time
encryptionMode: StrategyEncryptionMode!
keyCustodyBackend: StrategyKeyCustodyBackend!
keyID: String
keyVersion: Int
algorithm: StrategyEncryptionAlgorithm!
encryptedAt: Time
name: String!
description: String
code: String
config: Map!
builderMode: StrategyStrategyBuilderMode!
tradingMode: StrategyStrategyTradingMode!
timeframe: String!
stakeCurrency: String!
positionMode: StrategyStrategyPositionMode!
parentID: ID
forkedFromID: ID
isLatest: Boolean!
versionNumber: Int!
ownerID: String!
createdAt: Time!
updatedAt: Time!
bots(
after: Cursor
first: Int
before: Cursor
last: Int
orderBy: [BotOrder!]
where: BotWhereInput
): BotConnection!
backtests(
after: Cursor
first: Int
before: Cursor
last: Int
orderBy: [BacktestOrder!]
where: BacktestWhereInput
): BacktestConnection!
simulations(
after: Cursor
first: Int
before: Cursor
last: Int
orderBy: [SimulationOrder!]
where: SimulationWhereInput
): SimulationConnection!
hyperopts(
after: Cursor
first: Int
before: Cursor
last: Int
orderBy: [HyperoptOrder!]
where: HyperoptWhereInput
): HyperoptConnection!
children: [Strategy!]
parent: Strategy
forkedFrom: Strategy
forks: [Strategy!]
encryptionLocked: Boolean!
uiBuilderConfig: UIBuilderConfig
wrappedDEKs: [WrappedDEK!]!
}

Fields

Strategy.backtestStats ● BacktestStats object

Aggregated backtest statistics for this strategy version. Provides best, worst, latest, and average metrics for easy comparison.

Strategy.runningBacktestCount ● Int! non-null scalar

Number of backtests in {running, pending} status for this strategy version. Server-derived at query time. Updates pushed via the strategyBacktestActivity subscription whenever a backtest crosses the active-set boundary — Apollo's normalized cache (Strategy:<id>) picks them up automatically, no client refetch / poll / debounce.

See docs/superpowers/specs/2026-05-13-strategy-running-backtest-count-design.md

Strategy.analysis ● StrategyAnalysis object

Cached analysis blob. Returns Unavailable when not yet computed (resolver lazy-fills).

Strategy.encryptionStatus ● EncryptionStatus! non-null object

Strategy.id ● ID! non-null scalar

Strategy.public ● Boolean! non-null scalar

Whether this resource is publicly visible to all authenticated users

Whether this resource is featured (appears at top of lists)

Strategy.deletedAt ● Time scalar

Soft-delete timestamp. If set, record is considered deleted.

Strategy.encryptionMode ● StrategyEncryptionMode! non-null enum

Trust-ladder encryption mode for this row's sensitive fields. Set at create time; immutable after. Defaults to 'legacy_server' for all rows created before the trust ladder shipped.

Strategy.keyCustodyBackend ● StrategyKeyCustodyBackend! non-null enum

KeyCustodyBackend implementation that produced the wrapping key. Pinned at write time alongside encryption_mode.

Strategy.keyID ● String scalar

Opaque identifier of the wrapping key, backend-specific. Null for legacy_server rows that use the global process key.

Strategy.keyVersion ● Int scalar

Rotation counter for the wrapping key. Null for legacy_server rows; populated when the row is rewrapped under a versioned key.

Strategy.algorithm ● StrategyEncryptionAlgorithm! non-null enum

Symmetric algorithm protecting the row's sensitive fields. Stored alongside the ciphertext so future migrations can retire algorithms without re-encrypting existing rows.

Strategy.encryptedAt ● Time scalar

Timestamp the row's sensitive fields were last encrypted with the current key_id/key_version. Null for legacy_server rows.

Strategy.name ● String! non-null scalar

Strategy name (not unique, allows versions)

Strategy.description ● String scalar

Strategy description

Strategy.code ● String scalar

Python strategy code (server-derived for ui builder_mode; required for code mode — enforced in the strategy domain, see ADR-0088)

Strategy.config ● Map! non-null scalar

Strategy-specific configuration (config.json) - REQUIRED

Strategy.builderMode ● StrategyStrategyBuilderMode! non-null enum

Strategy editing mode: 'ui' for UI builder (code generated from config), 'code' for direct Python editing

Strategy.tradingMode ● StrategyStrategyTradingMode! non-null enum

Mirrored from config.trading_mode — normalized uppercase so it can be filtered/indexed

Strategy.timeframe ● String! non-null scalar

Mirrored from config.timeframe (e.g. '1m', '5m', '1h') — default '5m'

Strategy.stakeCurrency ● String! non-null scalar

Mirrored from config.stake_currency (e.g. 'USDT', 'BTC') — default 'USDT'

Strategy.positionMode ● StrategyStrategyPositionMode! non-null enum

Mirrored from ui_builder_config.position_mode for UI strategies; defaults LONG_AND_SHORT for code strategies

Strategy.parentID ● ID scalar

Parent strategy ID for versioning (null for root v1)

Strategy.forkedFromID ● ID scalar

Original strategy ID this was forked from (null if not forked)

Strategy.isLatest ● Boolean! non-null scalar

Indicates if this is the latest version of the strategy

Strategy.versionNumber ● Int! non-null scalar

Auto-incremented version number

Strategy.ownerID ● String! non-null scalar

Group ID (organization) that owns this strategy

Strategy.createdAt ● Time! non-null scalar

Strategy.updatedAt ● Time! non-null scalar

Strategy.bots ● BotConnection! non-null object

Strategy.bots.after ● Cursor scalar

Returns the elements in the list that come after the specified cursor.

Strategy.bots.first ● Int scalar

Returns the first _n_ elements from the list.

Strategy.bots.before ● Cursor scalar

Returns the elements in the list that come before the specified cursor.

Strategy.bots.last ● Int scalar

Returns the last _n_ elements from the list.

Strategy.bots.orderBy ● [BotOrder!] list input

Ordering options for Bots returned from the connection.

Strategy.bots.where ● BotWhereInput input

Filtering options for Bots returned from the connection.

Strategy.backtests ● BacktestConnection! non-null object

Strategy.backtests.after ● Cursor scalar

Returns the elements in the list that come after the specified cursor.

Strategy.backtests.first ● Int scalar

Returns the first _n_ elements from the list.

Strategy.backtests.before ● Cursor scalar

Returns the elements in the list that come before the specified cursor.

Strategy.backtests.last ● Int scalar

Returns the last _n_ elements from the list.

Strategy.backtests.orderBy ● [BacktestOrder!] list input

Ordering options for Backtests returned from the connection.

Strategy.backtests.where ● BacktestWhereInput input

Filtering options for Backtests returned from the connection.

Strategy.simulations ● SimulationConnection! non-null object

Strategy.simulations.after ● Cursor scalar

Returns the elements in the list that come after the specified cursor.

Strategy.simulations.first ● Int scalar

Returns the first _n_ elements from the list.

Strategy.simulations.before ● Cursor scalar

Returns the elements in the list that come before the specified cursor.

Strategy.simulations.last ● Int scalar

Returns the last _n_ elements from the list.

Strategy.simulations.orderBy ● [SimulationOrder!] list input

Ordering options for Simulations returned from the connection.

Strategy.simulations.where ● SimulationWhereInput input

Filtering options for Simulations returned from the connection.

Strategy.hyperopts ● HyperoptConnection! non-null object

Strategy.hyperopts.after ● Cursor scalar

Returns the elements in the list that come after the specified cursor.

Strategy.hyperopts.first ● Int scalar

Returns the first _n_ elements from the list.

Strategy.hyperopts.before ● Cursor scalar

Returns the elements in the list that come before the specified cursor.

Strategy.hyperopts.last ● Int scalar

Returns the last _n_ elements from the list.

Strategy.hyperopts.orderBy ● [HyperoptOrder!] list input

Ordering options for Hyperopts returned from the connection.

Strategy.hyperopts.where ● HyperoptWhereInput input

Filtering options for Hyperopts returned from the connection.

Strategy.children ● [Strategy!] list object

Child strategy versions derived from this strategy (self-referential, via parent_id)

Strategy.parent ● Strategy object

Strategy.forkedFrom ● Strategy object

Original strategy this was forked from

Strategy.forks ● [Strategy!] list object

Strategies forked from this one

Strategy.encryptionLocked ● Boolean! non-null scalar

True when the strategy has at least one passphrase-encrypted IP field (code / config / ui_builder_config / analysis) that the current session could not decrypt. Editors must surface an unlock prompt and refuse Save while this is true.

Strategy.uiBuilderConfig ● UIBuilderConfig object

UI builder configuration — only present for builder_mode='ui' strategies

Strategy.wrappedDEKs ● [WrappedDEK!]! non-null object

All envelopes wrapping the strategy's DEK to a passkey public key. Populated only when the strategy is encrypted under T2.2; empty list means the strategy is either plaintext or encrypted under an earlier trust tier (T1.1 passphrase, T1.4 strict mode).

Authorization piggybacks on the parent Strategy.@hasScope check — this list is opaque ciphertext, but exposing it across orgs would reveal who has access, so we restrict to the resource's own view-scope holders.

Interfaces

Node interface

An object with an ID. Follows the Relay Global Object Identification Specification

Returned By

applyHyperoptParamsToStrategy mutation ● createStrategy mutation ● createStrategyWithPassphrase mutation ● decryptStrategyOnce mutation ● forkStrategy mutation ● renameStrategy mutation ● setStrategyFeatured mutation ● setStrategyUIBuilderEncrypted mutation ● setStrategyVisibility mutation ● strategy query ● strategyBacktestActivity subscription ● strategyVersions query ● updateStrategy mutation ● updateStrategyCodeWithPassphrase mutation ● updateStrategyWithPassphrase mutation

Member Of

Backtest object ● Bot object ● Hyperopt object ● Simulation object ● Strategy object ● StrategyEdge object