[pyne-worker evaluate]

POST /run, libraries, alerts, scripts, ingest, and 1m cron on the Python edge host.

pyne-worker evaluate

Abstract

The Worker’s evaluate path is POST /run with the same envelope as Flask: script + OHLCV + modeplots / series / events / alerts. Auth is X-API-Key (API_KEY secret). Wall timeout defaults to 30s.

Sister repo: hoox-sh/pyne-worker. Contract: evaluate contract.

Endpoints

MethodPathAuthRole
GET/healthnoLiveness + binding flags
POST/runyesEvaluate (script or script_id)
POST/ingestyesUpload OHLCV to R2
POST/scriptsyesDeploy a script
GET/scriptsyesList deployed scripts
GET/scripts/:idyesGet deployed script
DELETE/scripts/:idyesDelete deployed script
GET/cron/jobsyesList bar-close jobs
PUT/cron/jobsyesReplace job list
POST/cron/runyesTrigger scheduler
POST/feed/refreshyesPull klines into R2

POST /run

Accepts data (Pro API name) or ohlcv. Omit bars and pass symbol + timeframe to load R2 history.

{
  "script": "//@version=5\nindicator(\"t\")\nplot(close)",
  "ohlcv": [
    {"open": 100, "high": 105, "low": 95, "close": 102, "time": 1000, "volume": 1000}
  ],
  "symbol": "BTCUSDT",
  "mode": "auto"
}
FieldNotes
scriptInline Pine
script_idLoad a deployed script instead of script
ohlcv / dataBars; or omit and use R2
modeinterpret (default) · compile · auto
inputsinput.* overrides (forces interpret under auto)
libraries[{namespace, name, version, source}] — max 32
profilerPer-line interpret timings
timeout_secondsWall budget (default 30, cap 30)
webhook_urlPer-job L2 alert URL (else ALERT_WEBHOOK_URL)

Success includes status, plots, series, plot_meta, alerts, events, drawings, inputs, logs, meta. Failures use error / error_kind.

Deployed scripts can store libraries and inputs. script_id and cron reuse them.

Alerts and trades

  • alert() / alertcondition() export on /run (same engine as Pro API).
  • L2 HTTP POST: secret ALERT_WEBHOOK_URL or per-job webhook_url.
  • Optional TRADE_SERVICE binding forwards strategy events to trade-worker. Remove the services block if that Worker is not in the account (fails closed).

Limits

CapValue
Script100 KB
Bars100K
Envelope5 MB
/run wall30 s
Rate100 req / 60 s

See also