Skip to main content
The Strategy DSL has two layers:
  • A boolean rules tree that decides whether a strategy should fire.
  • Numeric expressions, such as size_expr, that decide how much the strategy should send to OMS.

Rule Nodes

Use shallow rule trees when possible. Deep trees are harder to review and usually indicate that two strategy lanes should be split.

Expression Guidelines

Expressions are evaluated by the Strategy Engine against the current vault snapshot.
Avoid division in rule expressions unless the denominator is guaranteed non-zero. The validator dry-runs expressions against an empty snapshot to catch type and parse errors, which means division by zero can reject a strategy before it is saved.

Common Variables

Variable availability depends on the datafeed and vault snapshot. Common families include: Source-specific variables normalize addresses before aliasing. When in doubt, inspect the strategy validation error and the engine snapshot shown in Intent History.

size_expr

action_config.size_expr is numeric. It should evaluate to the amount OMS should act on, in the underlying asset’s base units. Rules for sizing:
  • It must be positive at runtime.
  • It should be bounded by available liquidity or allocation.
  • It should match the action direction. Deposit sizes should not exceed idle assets; withdrawal sizes should not exceed source allocation.
  • It should be easy to audit from dashboard numbers.
Examples:

Conviction Config

conviction_config controls how many passing ticks are required before a strategy publishes. Use BINARY for simple operational gates. Add stronger conviction only when false positives are expensive and delayed action is acceptable.

Validation Timing

The Strategy Engine validates at create and update time:
  • JSON shape and required fields.
  • Known action names and lane compatibility.
  • Expression parseability.
  • Basic dry-run evaluation.
  • Address formatting.
  • Version conflicts on update.
Runtime checks still apply after validation. A strategy can save successfully and later fail to publish if it lacks a session key, merkle proof, active yield source, or executable OMS route.