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

# trade.observation-request@1 · OpenVibe.Services

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

# TradeObservationRequest `trade.observation-request@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/observation-request.v1.json`](/docs/contracts/trade.observation-request.json)

trade.observation-request@1: the body of POST /api/v1/observations on OpenVibe.Trade (trade.observation.write; services only): one value a source stated for an instrument (symbol or instrument\_id). value is the finite decimal as stated; observed\_at and retrieved\_at are date-times with a zone and not in the future; source\_key names the OpenVibe.Sources source and source\_ref the statement within it. The same source reference with the same value is answered as it was (200); a different value under the same reference is 409 observation.conflict (a correction needs its own source\_ref).

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `symbol` | string |  |  |  |
| `instrument_id` | string |  |  |  |
| `metric` | string | yes |  | - `pattern ^\s*[A-Za-z][A-Za-z0-9_.:-]{0,79}\s*$` |
| `value` | string \| number | yes |  |  |
| `unit` | string | yes |  | - `pattern ^\s*[A-Za-z][A-Za-z0-9/%._-]{0,19}\s*$` |
| `currency` | string \| null |  |  | - `pattern ^\s*([A-Z]{3})?\s*$` |
| `period` | string \| null |  |  | - `maxLength 40` |
| `observed_at` | string | yes |  |  |
| `retrieved_at` | string | yes |  |  |
| `source_key` | string | yes |  | - `pattern ^\s*[a-z0-9][a-z0-9-]{1,63}\s*$` |
| `source_ref` | string | yes |  | - `minLength 1`<br>- `maxLength 300` |
| `source_item_id` | string \| null |  |  | - `pattern ^(itm_[0-9A-HJKMNP-TV-Z]{26})?$` |
| `source_url` | string \| null |  |  | - `pattern ^https?://` |
| `max_age_sec` | integer \| string \| null |  |  | - `minimum 60`<br>- `maximum 315360000` |

## Examples

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

 Valid: close

~~~~
{
  "symbol": "ACME",
  "metric": "close",
  "value": "182.40",
  "unit": "USD",
  "currency": "USD",
  "period": "2026-09-24",
  "observed_at": "2026-09-24T20:00:00Z",
  "retrieved_at": "2026-09-24T21:05:00Z",
  "source_key": "example-quotes",
  "source_ref": "ACME:2026-09-24:close",
  "source_url": "https://quotes.example.com/ACME",
  "max_age_sec": 172800
}
~~~~

Rejected: no-source-ref

~~~~
{
  "symbol": "ACME",
  "metric": "close",
  "value": "182.40",
  "unit": "USD",
  "observed_at": "2026-09-24T20:00:00Z",
  "retrieved_at": "2026-09-24T21:05:00Z",
  "source_key": "example-quotes"
}
~~~~

## Validate

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