---
title: "trade.alert-rule@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/trade.alert-rule"
updated: null
---

# trade.alert-rule@1 · OpenVibe.Services

HTML: [trade.alert-rule@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/trade.alert-rule)

# TradeAlertRule `trade.alert-rule@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: trade
- Visibility: first-party
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/trade/alert-rule.v1.json`](/docs/contracts/trade.alert-rule.json)

trade.alert-rule@1: one alert rule of a person on OpenVibe.Trade (server/domain/alerts.js ruleDto): a threshold on a metric, filings of some form types, or any new document for an instrument. Alerts inform; they never trade.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `id` | string | yes |  |  |
| `kind` | enum | yes |  | - `one of "threshold", "filing_type", "new_document"` |
| `status` | string | yes |  |  |
| `instrument` | object | yes |  |  |
| `instrument.id` | string | yes |  |  |
| `instrument.symbol` | string |  |  |  |
| `instrument.name` | string |  |  |  |
| `metric` | string \| null |  |  |  |
| `operator` | enum |  |  | - `one of "above", "below", null` |
| `threshold` | string \| null |  |  |  |
| `unit` | string \| null |  |  |  |
| `currency` | string \| null |  |  |  |
| `form_types` | array \| null |  |  |  |
| `armed` | boolean \| null |  |  |  |
| `created_at` | string \| null |  |  | - `format date-time` |
| `updated_at` | string \| null |  |  | - `format date-time` |

## Examples

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

 Valid: threshold

~~~~
{
  "id": "alr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "kind": "threshold",
  "status": "active",
  "instrument": {
    "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "symbol": "ACME",
    "name": "Acme Corporation"
  },
  "metric": "close",
  "operator": "below",
  "threshold": "150",
  "unit": "USD",
  "currency": "USD",
  "form_types": null,
  "armed": true,
  "created_at": "2026-09-25T10:00:00.000Z",
  "updated_at": "2026-09-25T10:00:00.000Z"
}
~~~~

Rejected: bad-operator

~~~~
{
  "id": "alr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "kind": "threshold",
  "status": "active",
  "instrument": {
    "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "symbol": "ACME",
    "name": "Acme Corporation"
  },
  "metric": "close",
  "operator": "crosses",
  "threshold": "150",
  "unit": "USD",
  "currency": "USD",
  "form_types": null,
  "armed": true,
  "created_at": "2026-09-25T10:00:00.000Z",
  "updated_at": "2026-09-25T10:00:00.000Z"
}
~~~~

## Validate

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