Hey-LiSA is in development phase and pre-alpha. These docs are still in progress and not complete yet.

Language structure

LiSA Script strategies are JSON documents made of ordered rules. DCA currently uses version 2 and Trading uses version 5. Both require an explicit category and use separate validated contracts.

Shared fields

FieldPurpose
versionCategory contract version: 2 for DCA and 5 for Trading.
typeMust be "strategy".
categoryMust be "dca" or "trading". It is authored and not inferred from labels or actions.
nameHuman-readable strategy name.
compact_descriptionShort card summary.
descriptionLonger report description.
labelsRequired strategy classification IDs used on cards and by filters.
marketCurrent market, currently "BTC".
timeframeStrategy timeframe. DCA uses "1d"; Trading accepts "1d" or "4h".
executionSimulated fill timing and cost assumptions.
indicatorsBuilt-in technical indicator declarations.
rulesOrdered decision and action rules.
constraintsBacktest start and end bounds.

Names are the readable labels shown in reports. Hey-LiSA generates internal structural IDs for evaluation, traces, reports, and graph layout. LiSA Script does not accept authored rule, branch, IF, action, or condition IDs.

DCA category

A DCA strategy uses:

  • category: "dca"
  • portfolio with USDC starting cash
  • optional external_series
  • DCA actions such as cashflow, buy, sell, and set
  • direct actions, ordered actions, condition gates, branches, and nested IF rules

Every current DCA strategy includes the btc label and exactly one style label, dca or special. Optional study labels use stable IDs such as fear-greed-study.

"labels": ["btc", "dca", "fear-greed-study"]

Trading category

A Trading strategy uses:

  • category: "trading"
  • an explicit timeframe of "1d" or "4h"
  • account with a positive USDC starting balance
  • open_position and close_position
  • simple ordered rules containing named conditions and one named action
  • optional ordered, named exit_conditions groups written inline on an open_position
  • position_state() to require a flat, long, or short position
  • percent_equity sizing with explicit leverage: 1, or risk_percent_equity_at_stop sizing with leverage derived from the resolved stop

Every current Trading strategy includes btc, trading, and exactly one direction label: long, short, or long-short. Optional authored study labels use the same central label contract as DCA, and validated indicator reads add backend-derived indicator labels to cards and reports. The stop-loss review strategies use the stop-loss-suite study label.

Trading does not currently accept DCA portfolio fields, cashflows, external series, state variables, branches, or nested IF rules.

See Actions and execution for the category-specific action shapes.

DCA rule forms

FormShape
Direct action{ "name", "action": { ... } }
Ordered actions{ "name", "actions": [{ ... }, ...] }
Condition gate{ "name", "conditions": [...], "action" or "actions" or "branches" }
IF tree{ "name", "if": { "name", "conditions", "then", "else" } }
Branch list{ "name", "branches": [{ "name", "when", ... }, { "name", "else": true, ... }] }

Rule-level conditions can gate one action, ordered actions, or a branch list. IF targets can contain a nested IF, one action, or ordered actions. Branch lists execute the first matching branch. An else branch must be last.

Minimal DCA rule

{
  "name": "Add daily contribution",
  "action": {
    "name": "Add daily contribution",
    "type": "cashflow",
    "amount": 50
  }
}