Skip to content

Commit

Permalink
finos#644 | Add Order and OrderLeg Context Types
Browse files Browse the repository at this point in the history
  • Loading branch information
nemery-flextrade committed Sep 29, 2022
1 parent afc85df commit 342173f
Show file tree
Hide file tree
Showing 9 changed files with 511 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### Added
* Added a context type representing an Order (`fdc3.order`). ([]())

### Changed

Expand Down
36 changes: 36 additions & 0 deletions docs/context/ref/Order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
id: Order
sidebar_label: Order
title: Order
hide_title: true
---
# `Order`

A context type representing the details of an order, which may be used to transmit a new order to a third party or share details of an existing order.

When the intenet is to create an Order in a downstream system at least one OrderLeg MUST be populated.

When the intent is to lookup an Order in a downstream system at least one entry MUST be populated in the id field and other fields are not required.

## Type

`fdc3.order`

## Schema

https://fdc3.finos.org/scehmas/next/order.schema.json

## Details

| Property| Type| Required| Example
| -| -| -| -
| `id` | object | Yes | `{'OMS': '123456789'}`
| `id.OMS` | string | No | `'123456789'`
| `id.EMS` | string | No | `'EMSID1234'`
| `id.PMS` | string | No | `'PMS12345'`
| `sendingTime` | string | Yes | `'2022-03-30T15:44:44+00:00'`
| `timeInForce` | fdc3.timeRange| No | `{type: "fdc3.timeRange", startTime: "2020-09-01T08:00:00.000Z", endTime: "2020-10-31T08:00:00.000Z"}`
| `orderLegs` | fdc3.orderLeg[] | Yes |
| `notes` | String | No


50 changes: 50 additions & 0 deletions docs/context/ref/OrderLeg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
id: OrderLeg
sidebar_label: OrderLeg
title: OrderLeg
hide_title: true
---
# `OrderLeg`

A context type representing the details of an individual order leg, which MAY be used as part of an Order context when creating a new Order and MAY be transmitted separately to look up details of an existing OrderLeg.

When the OrderLeg is part of an Order context with the intent to CREATE a new Order fields MUST be populated as indicated.

When the intent is to lookup an OrderLeg in a downstream system at least one entry MUST be populated in the id field and other fields are NOT required.

## Type

`fdc3.orderLeg`

## Schema

https://fdc3.finos.org/scehmas/next/orderLeg.schema.json

| Property| Type| Required| Example
| -| -| -| -
| `type` | String | Yes | `fdc3.orderLeg`
| `id` | object | Yes | `{'OMS': '123456789-leg1'}`
| `product` | object | Yes | `{'instrument': {'ticker':'MSFT'}} \| {'productDefinition': '...'}`
| `product.instrument` | fdc3.Instrument | No | `{'instrument': {'ticker':'MSFT'}}`
| `product.productDefinition` | object | No | `{'productDefinition': '...'}`
| `quantity` | object | Yes | `{'units': 100000.00}`
| `quantity.units` | double | No | `1000000.00`
| `quantity.cashValue` | double | No | `5000000.00`
| `quantity.proceedsFrom` | string | No | `{'OMS': '123456789-leg2'}`
| `currency` | fdc3.currency | No | `{type: 'fdc3.currency', name: 'US Dollar', id: {CURRENCY_ISOCODE: "USD"}}`
| `side` | string | Yes | `'B' \| 'S' \| 'P' \| 'R'...`
| `price` | object | Yes | `{'orderType': 'limit', 'limitPrice': 123.45}`
| `price.priceType` | string | No | `'absolute' \| 'percentage' \| 'yield' \| 'spread'...`
| `price.orderType` | string | Yes | `'limit' \| 'market' \| 'stopMarket' \| 'stopLimit'...`
| `price.limitPrice` | double | No | `1.15`
| `price.stopPrice` | double | No | `1.20`
| `settlement` | object | No | `{currency: {type: 'fdc3.currency', name: 'Pound Sterling', id: {CURRENCY_ISOCODE: "GBP"}, 'date': '2022-03-30T15:44:44+00:00'}`
| `settlement.currency` | fdc3.currency | No | `{type: 'fdc3.currency', name: 'Pound Sterling', id: {CURRENCY_ISOCODE: "GBP"}`
| `settlement.date` | string | No | `'2022-03-30T15:44:44+00:00'`
| `allocations` | object[] | No | `[{'account': 'TRADEACCOUNT1', 'quantity': 1000000.00, 'positionEffect': 'O'}]`
| `allocations[i].account` | string | Yes | `TRADEACCOUNT1`
| `allocations[i].quantity` | double | No | `1000000.00`
| `allocations[i].positionEffect` | string | No | `'O' \| 'C'`
| `partyIdentifiers` | object[] | No | `[{'role': 'executingFirm', 'id': {'LEI': '549300UO56I4KIWC0U51'}]`
| `partyIdentifiers[i].role` | string | Yes | `'executingFirm'`
| `partyIdentifiers[i].id` | string | Yes | `{'LEI': '549300UO56I4KIWC0U51'}`
2 changes: 2 additions & 0 deletions src/context/schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"Instrument": ["https://fdc3.finos.org/schemas/next/instrument.schema.json"],
"InstrumentList": ["https://fdc3.finos.org/schemas/next/instrumentList.schema.json"],
"Nothing": ["https://fdc3.finos.org/schemas/next/nothing.schema.json"],
"Order": ["https://fdc3.finos.org/schemas/next/order.schema.json"],
"OrderLeg": ["https://fdc3.finos.org/schemas/next/orderLeg.schema.json"],
"Organization": ["https://fdc3.finos.org/schemas/next/organization.schema.json"],
"Portfolio": ["https://fdc3.finos.org/schemas/next/portfolio.schema.json"],
"Position": ["https://fdc3.finos.org/schemas/next/position.schema.json"],
Expand Down
44 changes: 44 additions & 0 deletions src/context/schemas/order.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/order.schema.json",
"type": "object",
"title": "Order",
"allOf": [
{
"$ref": "context.schema.json#"
}
],
"properties": {
"type": {
"const": "fdc3.order"
},
"id": {
"properties": {
"EMS": {
"type": "string"
},
"OMS": {
"type": "string"
},
"PMS": {
"type": "string"
}
}
},
"sendingTime": {
"type": "string"
},
"timeInForce": {
"$ref": "timerange.schema.json#"
},
"orderLegs": {
"type": "array",
"items": {
"$ref": "orderLeg.schema.json#"
}
},
"notes": {
"type": "string"
}
}
}
166 changes: 166 additions & 0 deletions src/context/schemas/orderLeg.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/orderLeg.schema.json",
"type": "object",
"title": "orderLeg",
"allOf": [
{
"$ref": "context.schema.json#"
}
],
"properties": {
"type": {
"const": "fdc3.orderLeg"
},
"id": {
"properties": {
"EMS": {
"type": "string"
},
"OMS": {
"type": "string"
},
"PMS": {
"type": "string"
}
}
},
"product": {
"type": "object",
"properties": {
"oneof": {
"instrument": {
"$ref": "instrument.schema.json#"
},
"productDefinition": {
"type": "object"
}
}
}
},
"quantity": {
"type": "object",
"properties": {
"oneof": {
"units": {
"type": "number"
},
"cashValue": {
"type": "number"
},
"proceedsFrom": {
"type": "string"
}
}
}
},
"currency": {
"$ref": "currency.schema.json#"
},
"side": {
"type": "string",
"enum": [
"B",
"S",
"P",
"R",
"BS",
"SS"
]
},
"price": {
"type": "object",
"properties": {
"orderType": {
"type": "string",
"enum": [
"limit",
"market",
"stopMarket",
"stopLimit"
]
},
"limitPrice": {
"type": "number"
},
"stopPrice": {
"type": "number"
},
"priceType": {
"type": "string",
"enum": [
"absolute",
"percentage",
"yield",
"spread"
]
}
},
"required": [
"orderType"
]
},
"settlement": {
"type": "object",
"properties": {
"currency": {
"$ref": "currency.schema.json#"
},
"date": {
"type": "string"
}
}
},
"allocations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"account": {
"type": "string"
},
"quantity": {
"type": "number"
},
"positionEffect": {
"type": "string",
"enum": [
"O",
"C"
]
}
},
"required": [
"account"
]
}
},
"partyIdentifiers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string"
},
"id": {
"type": "object",
"properties": {
"LEI": {
"type": "string"
}
}
}
}
}
}
},
"required": [
"type",
"id",
"price",
"side",
"product",
"quantity"
]
}
2 changes: 2 additions & 0 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
"context/ref/Instrument",
"context/ref/InstrumentList",
"context/ref/Nothing",
"context/ref/Order",
"context/ref/OrderLeg",
"context/ref/Organization",
"context/ref/Portfolio",
"context/ref/Position",
Expand Down
44 changes: 44 additions & 0 deletions website/static/schemas/next/order.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/order.schema.json",
"type": "object",
"title": "Order",
"allOf": [
{
"$ref": "context.schema.json#"
}
],
"properties": {
"type": {
"const": "fdc3.order"
},
"id": {
"properties": {
"EMS": {
"type": "string"
},
"OMS": {
"type": "string"
},
"PMS": {
"type": "string"
}
}
},
"sendingTime": {
"type": "string"
},
"timeInForce": {
"$ref": "timerange.schema.json#"
},
"orderLegs": {
"type": "array",
"items": {
"$ref": "orderLeg.schema.json#"
}
},
"notes": {
"type": "string"
}
}
}
Loading

0 comments on commit 342173f

Please sign in to comment.