TradeAlertTriggeredPayload trade.alert.triggered@1

Generated at from openvibe-contracts v0.33.0 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
trade
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-020
Schema
https://openvibe.network/contracts/events/payloads/trade.alert.triggered.v1.json

trade.alert.triggered v1 (OpenVibe.Trade server/domain/alerts.js deliver). One delivery of one private alert rule: a threshold crossed by a new observation (trigger kind observation), or a newly seen document of the instrument (filing_type / new_document rules, trigger kind document). Written in the transaction that recorded the observation or document; at most one per (rule, trigger). Envelope: subject { type: user, id: <rule owner usr_…> }, visibility subject, priority important, actor service:trade. Data only, never rendered notification text (ADR-020): OpenVibe.Network renders a TRADE_ALERT notification (server/notifications/events-consumer.js). Information only, not investment advice.

Fields

FieldTypeRequiredDescriptionConstraints
delivery_idstringyes
  • pattern ^ald_[0-9A-HJKMNP-TV-Z]{26}$
ruleobjectyes
  • no other fields
rule.idstringyes
  • pattern ^alr_[0-9A-HJKMNP-TV-Z]{26}$
rule.kindenumyes
  • one of "threshold", "filing_type", "new_document"
rule.statusenumyes
  • one of "active", "deleted"
rule.instrumentobjectyes
  • no other fields
rule.instrument.idstringyes
  • pattern ^ins_[0-9A-HJKMNP-TV-Z]{26}$
rule.instrument.symbolstring
rule.instrument.namestring
rule.metricstring | nullyesThreshold rules: e.g. price.close, volume, us-gaap:Revenues.
  • maxLength 80
rule.operatorenumyes
  • one of "above", "below", null
rule.thresholdstring | nullyesDecimal text as entered.
  • maxLength 64
rule.unitstring | nullyes
  • maxLength 20
rule.currencystring | nullyes
  • pattern ^[A-Z]{3}$
rule.form_typesarray | nullyesfiling_type rules: the 1–10 form types that trigger it (10-K, 8-K…).
rule.armedboolean | nullyesThreshold rules: armed before this delivery (always true when it fired); null for document rules.
rule.created_atstringyes
  • format date-time
rule.updated_atstringyes
  • format date-time
instrumentobjectyes
  • no other fields
instrument.idstringyes
  • pattern ^ins_[0-9A-HJKMNP-TV-Z]{26}$
instrument.symbolstringyes
  • minLength 1
  • maxLength 32
instrument.namestringyes
  • minLength 1
  • maxLength 300
instrument.urlstringyesInstrument page on Trade.
  • pattern ^https?://
  • format uri
  • maxLength 2048
triggerone ofyes
disclaimerstringyesCurrently "Information only — not investment advice; no trading here."
  • minLength 1
  • maxLength 200

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: filing
{
  "delivery_id": "ald_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "rule": {
    "id": "alr_01JAB2C3D4E5F6G7H8J9K0MNPR",
    "kind": "filing_type",
    "status": "active",
    "instrument": {
      "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPS",
      "symbol": "AAPL",
      "name": "Apple Inc."
    },
    "metric": null,
    "operator": null,
    "threshold": null,
    "unit": null,
    "currency": null,
    "form_types": [
      "10-K",
      "8-K"
    ],
    "armed": null,
    "created_at": "2026-09-20T10:00:00.000Z",
    "updated_at": "2026-09-20T10:00:00.000Z"
  },
  "instrument": {
    "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPS",
    "symbol": "AAPL",
    "name": "Apple Inc.",
    "url": "https://openvibe.trade/i/AAPL"
  },
  "trigger": {
    "kind": "document",
    "id": "doc_01JAB2C3D4E5F6G7H8J9K0MNPT",
    "form_type": "8-K",
    "title": "Current report",
    "url": "https://www.sec.gov/Archives/edgar/data/320193/000032019326000001/0000320193-26-000001-index.htm",
    "published_at": "2026-09-22T12:00:00.000Z",
    "retrieved_at": "2026-09-22T12:10:00.000Z",
    "source_key": "sec-edgar-filings"
  },
  "disclaimer": "Information only — not investment advice; no trading here."
}
Valid: threshold
{
  "delivery_id": "ald_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "rule": {
    "id": "alr_01JAB2C3D4E5F6G7H8J9K0MNPR",
    "kind": "threshold",
    "status": "active",
    "instrument": {
      "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPS",
      "symbol": "AAPL",
      "name": "Apple Inc."
    },
    "metric": "price.close",
    "operator": "above",
    "threshold": "250",
    "unit": "USD",
    "currency": "USD",
    "form_types": null,
    "armed": true,
    "created_at": "2026-09-20T10:00:00.000Z",
    "updated_at": "2026-09-22T21:00:00.000Z"
  },
  "instrument": {
    "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPS",
    "symbol": "AAPL",
    "name": "Apple Inc.",
    "url": "https://openvibe.trade/i/AAPL"
  },
  "trigger": {
    "kind": "observation",
    "id": "obs_01JAB2C3D4E5F6G7H8J9K0MNPT",
    "metric": "price.close",
    "value": "251.37",
    "unit": "USD",
    "currency": "USD",
    "observed_at": "2026-09-22T20:00:00.000Z",
    "retrieved_at": "2026-09-22T20:05:00.000Z",
    "source_key": "stooq-daily",
    "source_url": null
  },
  "disclaimer": "Information only — not investment advice; no trading here."
}
Rejected: observation-without-value
{
  "delivery_id": "ald_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "rule": {
    "id": "alr_01JAB2C3D4E5F6G7H8J9K0MNPR",
    "kind": "threshold",
    "status": "active",
    "instrument": {
      "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPS",
      "symbol": "AAPL",
      "name": "Apple Inc."
    },
    "metric": "price.close",
    "operator": "above",
    "threshold": "250",
    "unit": "USD",
    "currency": "USD",
    "form_types": null,
    "armed": true,
    "created_at": "2026-09-20T10:00:00.000Z",
    "updated_at": "2026-09-22T21:00:00.000Z"
  },
  "instrument": {
    "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPS",
    "symbol": "AAPL",
    "name": "Apple Inc.",
    "url": "https://openvibe.trade/i/AAPL"
  },
  "trigger": {
    "kind": "observation",
    "id": "obs_01JAB2C3D4E5F6G7H8J9K0MNPT",
    "metric": "price.close",
    "unit": "USD",
    "currency": "USD",
    "observed_at": "2026-09-22T20:00:00.000Z",
    "retrieved_at": "2026-09-22T20:05:00.000Z",
    "source_key": "stooq-daily",
    "source_url": null
  },
  "disclaimer": "Information only — not investment advice; no trading here."
}
Rejected: rendered-text
{
  "delivery_id": "ald_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "rule": {
    "id": "alr_01JAB2C3D4E5F6G7H8J9K0MNPR",
    "kind": "new_document",
    "status": "active",
    "instrument": {
      "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPS"
    },
    "metric": null,
    "operator": null,
    "threshold": null,
    "unit": null,
    "currency": null,
    "form_types": null,
    "armed": null,
    "created_at": "2026-09-20T10:00:00.000Z",
    "updated_at": "2026-09-20T10:00:00.000Z"
  },
  "instrument": {
    "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPS",
    "symbol": "AAPL",
    "name": "Apple Inc.",
    "url": "https://openvibe.trade/i/AAPL"
  },
  "trigger": {
    "kind": "document",
    "id": "doc_01JAB2C3D4E5F6G7H8J9K0MNPT",
    "form_type": null,
    "title": null,
    "url": null,
    "published_at": null,
    "retrieved_at": "2026-09-22T12:10:00.000Z",
    "source_key": "sec-edgar-filings"
  },
  "message": "AAPL filed a new document",
  "disclaimer": "Information only — not investment advice; no trading here."
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('trade.alert.triggered@1', value);   // { valid, errors: [{ path, message }] }