SPB Git

Repository Public

signal-output-v2.schema.json 1.9 KB 52 lines json

1{2  "$schema": "https://json-schema.org/draft/2020-12/schema",3  "$id": "https://sp-wallet.local/schema/signal-output-v2.schema.json",4  "title": "Output of python -m spq.signal --contract 2 for a perpetual-futures strategy (one line on stdout, exit code 0)",5  "description": "Version 2 of the signal output. The version-1 output (signal-output.schema.json) is unchanged and is still what a spot strategy prints. The weights are TARGETS in fractions of account equity, not orders: sizing, margin, liquidation distance and every risk limit belong to the engine and the signer.",6  "type": "object",7  "required": [8    "schema_version",9    "kind",10    "strategy_sha256",11    "as_of",12    "weights",13    "max_leverage",14    "max_gross_exposure"15  ],16  "properties": {17    "schema_version": {18      "const": 219    },20    "kind": {21      "const": "perp"22    },23    "strategy_sha256": {24      "type": "string",25      "pattern": "^[0-9a-f]{64}$"26    },27    "as_of": {28      "type": "string",29      "format": "date-time",30      "description": "bar-open time (UTC) of the last closed bar the decision is based on; no input dated after it was used"31    },32    "weights": {33      "type": "object",34      "additionalProperties": {35        "type": "number"36      },37      "description": "one entry per symbol of META['universe']: signed notional / account equity, negative = short. A perpetual is within +/- max_leverage, a spot leg ('<SYMBOL>.SPOT') within [0, 1], and the absolute values sum to at most max_gross_exposure (checked by the runner before printing)"38    },39    "max_leverage": {40      "type": "number",41      "exclusiveMinimum": 0,42      "description": "META['max_leverage'], part of the hashed file"43    },44    "max_gross_exposure": {45      "type": "number",46      "exclusiveMinimum": 0,47      "description": "META['max_gross_exposure'], part of the hashed file"48    }49  },50  "additionalProperties": false51}52
Files main
Menu

Theme