diff --git a/packages/fdc3-context/generated/context/ContextTypes.ts b/packages/fdc3-context/generated/context/ContextTypes.ts index 99bf6e8e9..6082bdce8 100644 --- a/packages/fdc3-context/generated/context/ContextTypes.ts +++ b/packages/fdc3-context/generated/context/ContextTypes.ts @@ -1,6 +1,6 @@ // To parse this data: // -// import { Convert, Action, Chart, ChatInitSettings, ChatMessage, ChatRoom, ChatSearchCriteria, Contact, ContactList, Context, Country, Currency, Email, FileAttachment, Instrument, InstrumentList, Interaction, Message, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, TransactionResult, Valuation } from "./file"; +// import { Convert, Action, Chart, ChatInitSettings, ChatMessage, ChatRoom, ChatSearchCriteria, Contact, ContactList, Context, Country, Currency, Email, FileAttachment, Instrument, InstrumentList, Interaction, Message, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, Rfq, TimeRange, Trade, TradeList, TransactionResult, Valuation } from "./file"; // // const action = Convert.toAction(json); // const chart = Convert.toChart(json); @@ -26,6 +26,7 @@ // const portfolio = Convert.toPortfolio(json); // const position = Convert.toPosition(json); // const product = Convert.toProduct(json); +// const rfq = Convert.toRfq(json); // const timeRange = Convert.toTimeRange(json); // const trade = Convert.toTrade(json); // const tradeList = Convert.toTradeList(json); @@ -1587,6 +1588,10 @@ export interface Order { * An optional human-readable summary of the order. */ name?: string; + /** + * A description or set of notes. + */ + notes?: string; type: 'fdc3.order'; [property: string]: any; } @@ -1601,6 +1606,8 @@ export interface PurpleOrderDetails { } /** + * Details of the order to be quoted for + * * A product that is the subject of the trade. * * @experimental context type representing a tradable product. To be used with OMS and EMS @@ -1614,6 +1621,10 @@ export interface PurpleOrderDetails { * of the contract with custom identifiers if so desired. */ export interface ProductObject { + /** + * Details that further define this product. + */ + details?: PurpleProductDetails; /** * One or more identifiers that refer to the product. Specific key names for systems are * expected to be standardized in future. @@ -1627,10 +1638,147 @@ export interface ProductObject { * A human-readable summary of the product. */ name?: string; + /** + * A description or set of notes. + */ + notes?: string; type: 'fdc3.product'; [property: string]: any; } +/** + * Details that further define this product. + */ +export interface PurpleProductDetails { + /** + * A description of the product as a string mi the style often used by traders to describe + * products within a chat messaging system + */ + description?: string; + /** + * The exchange or marketplace where the product is offered + */ + exchange?: string; + /** + * Description of the parts of a multi-part transaction. + */ + legs?: PurpleLeg[]; + /** + * The type of order + */ + orderType?: OrderTypeEnum; + /** + * Logic used to determine the size, size limits and increments to use when trading the + * product. + */ + price?: PurpleProductPrice; + /** + * Logic used to determine the size, size limits and increments to use when trading the + * product. + */ + size?: PurpleProductSize; + /** + * A description of the the structure or strategy of the product + */ + structureType?: string; + [property: string]: any; +} + +/** + * A part of a multi-part transaction. + */ +export interface PurpleLeg { + /** + * For options, the date at which the contract expires. + */ + expirationDate?: string; + /** + * Unique identifier for this order leg within the multi-leg order + */ + id?: string; + /** + * The date on which the the issuer repays the holders. + */ + maturityDate?: string; + /** + * A 'per unit' quantity for the leg as a ratio of the order size. + */ + ratioQty?: number; + /** + * Indicates whether the asset is being bought or sold. + */ + side: Side; + /** + * The price at which the underlying asset is bought or sold + */ + strikePrice: number; + /** + * Indicates whether this Leg relates to a purchase or sale option. + */ + type: OptionType; + [property: string]: any; +} + +/** + * Indicates whether the asset is being bought or sold. + */ +export type Side = 'Buy' | 'Sell'; + +/** + * Indicates whether this Leg relates to a purchase or sale option. + */ +export type OptionType = 'Call' | 'Put'; + +/** + * The type of order + */ +export type OrderTypeEnum = + | 'market' + | 'limit' + | 'limit-sell' + | 'buy-stop' + | 'stop-loss' + | 'stop' + | 'day' + | 'gtc' + | 'iceberg' + | 'once-cancels-the-other' + | 'immediate-or-cancel' + | 'all-or-none' + | 'fill-or-kill'; + +/** + * Logic used to determine the size, size limits and increments to use when trading the + * product. + */ +export interface PurpleProductPrice { + tick?: number; + type?: number; +} + +/** + * Logic used to determine the size, size limits and increments to use when trading the + * product. + */ +export interface PurpleProductSize { + /** + * The amount to increment the size by + */ + increment?: number; + /** + * The maximum size + */ + max?: number; + /** + * The minimum size + */ + min?: number; + /** + * The + */ + type?: string; +} + /** * Free text to be used for a keyword search * @@ -1697,6 +1845,10 @@ export interface OrderElement { * An optional human-readable summary of the order. */ name?: string; + /** + * A description or set of notes. + */ + notes?: string; type: 'fdc3.order'; [property: string]: any; } @@ -1891,6 +2043,10 @@ export interface Position { * of the contract with custom identifiers if so desired. */ export interface Product { + /** + * Details that further define this product. + */ + details?: FluffyProductDetails; /** * One or more identifiers that refer to the product. Specific key names for systems are * expected to be standardized in future. @@ -1904,10 +2060,152 @@ export interface Product { * A human-readable summary of the product. */ name?: string; + /** + * A description or set of notes. + */ + notes?: string; type: 'fdc3.product'; [property: string]: any; } +/** + * Details that further define this product. + */ +export interface FluffyProductDetails { + /** + * A description of the product as a string mi the style often used by traders to describe + * products within a chat messaging system + */ + description?: string; + /** + * The exchange or marketplace where the product is offered + */ + exchange?: string; + /** + * Description of the parts of a multi-part transaction. + */ + legs?: FluffyLeg[]; + /** + * The type of order + */ + orderType?: OrderTypeEnum; + /** + * Logic used to determine the size, size limits and increments to use when trading the + * product. + */ + price?: FluffyProductPrice; + /** + * Logic used to determine the size, size limits and increments to use when trading the + * product. + */ + size?: FluffyProductSize; + /** + * A description of the the structure or strategy of the product + */ + structureType?: string; + [property: string]: any; +} + +/** + * A part of a multi-part transaction. + */ +export interface FluffyLeg { + /** + * For options, the date at which the contract expires. + */ + expirationDate?: string; + /** + * Unique identifier for this order leg within the multi-leg order + */ + id?: string; + /** + * The date on which the the issuer repays the holders. + */ + maturityDate?: string; + /** + * A 'per unit' quantity for the leg as a ratio of the order size. + */ + ratioQty?: number; + /** + * Indicates whether the asset is being bought or sold. + */ + side: Side; + /** + * The price at which the underlying asset is bought or sold + */ + strikePrice: number; + /** + * Indicates whether this Leg relates to a purchase or sale option. + */ + type: OptionType; + [property: string]: any; +} + +/** + * Logic used to determine the size, size limits and increments to use when trading the + * product. + */ +export interface FluffyProductPrice { + tick?: number; + type?: number; +} + +/** + * Logic used to determine the size, size limits and increments to use when trading the + * product. + */ +export interface FluffyProductSize { + /** + * The amount to increment the size by + */ + increment?: number; + /** + * The maximum size + */ + max?: number; + /** + * The minimum size + */ + min?: number; + /** + * The + */ + type?: string; +} + +/** + * @experimental context type representing a Request For Quote (RFQ). + */ +export interface Rfq { + broker?: string; + /** + * One or more identifiers that refer to the RFQ in an OMS or related system. Specific key + * names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * An optional human-readable summary of the RFQ. + */ + name?: string; + /** + * A description or set of notes. + */ + notes?: string; + /** + * Details of the order to be quoted for + */ + product: ProductObject; + type: 'fdc3.rfq'; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + /** * A context representing a period of time. Any user interfaces that represent or visualize * events or activity over time can be filtered or focused on a particular time period, @@ -1980,6 +2278,10 @@ export interface Trade { * A human-readable summary of the trade. */ name?: string; + /** + * A description or set of notes. + */ + notes?: string; /** * A product that is the subject of the trade. */ @@ -2044,6 +2346,10 @@ export interface TradeElement { * A human-readable summary of the trade. */ name?: string; + /** + * A description or set of notes. + */ + notes?: string; /** * A product that is the subject of the trade. */ @@ -2331,6 +2637,14 @@ export class Convert { return JSON.stringify(uncast(value, r('Product')), null, 2); } + public static toRfq(json: string): Rfq { + return cast(JSON.parse(json), r('Rfq')); + } + + public static rfqToJson(value: Rfq): string { + return JSON.stringify(uncast(value, r('Rfq')), null, 2); + } + public static toTimeRange(json: string): TimeRange { return cast(JSON.parse(json), r('TimeRange')); } @@ -2966,6 +3280,7 @@ const typeMap: any = { { json: 'details', js: 'details', typ: u(undefined, r('PurpleOrderDetails')) }, { json: 'id', js: 'id', typ: m('') }, { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'notes', js: 'notes', typ: u(undefined, '') }, { json: 'type', js: 'type', typ: r('OrderType') }, ], 'any' @@ -2973,13 +3288,55 @@ const typeMap: any = { PurpleOrderDetails: o([{ json: 'product', js: 'product', typ: u(undefined, r('ProductObject')) }], 'any'), ProductObject: o( [ + { json: 'details', js: 'details', typ: u(undefined, r('PurpleProductDetails')) }, { json: 'id', js: 'id', typ: m('') }, { json: 'instrument', js: 'instrument', typ: u(undefined, r('InstrumentElement')) }, { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'notes', js: 'notes', typ: u(undefined, '') }, { json: 'type', js: 'type', typ: r('ProductType') }, ], 'any' ), + PurpleProductDetails: o( + [ + { json: 'description', js: 'description', typ: u(undefined, '') }, + { json: 'exchange', js: 'exchange', typ: u(undefined, '') }, + { json: 'legs', js: 'legs', typ: u(undefined, a(r('PurpleLeg'))) }, + { json: 'orderType', js: 'orderType', typ: u(undefined, r('OrderTypeEnum')) }, + { json: 'price', js: 'price', typ: u(undefined, r('PurpleProductPrice')) }, + { json: 'size', js: 'size', typ: u(undefined, r('PurpleProductSize')) }, + { json: 'structureType', js: 'structureType', typ: u(undefined, '') }, + ], + 'any' + ), + PurpleLeg: o( + [ + { json: 'expirationDate', js: 'expirationDate', typ: u(undefined, '') }, + { json: 'id', js: 'id', typ: u(undefined, '') }, + { json: 'maturityDate', js: 'maturityDate', typ: u(undefined, '') }, + { json: 'ratioQty', js: 'ratioQty', typ: u(undefined, 3.14) }, + { json: 'side', js: 'side', typ: r('Side') }, + { json: 'strikePrice', js: 'strikePrice', typ: 3.14 }, + { json: 'type', js: 'type', typ: r('OptionType') }, + ], + 'any' + ), + PurpleProductPrice: o( + [ + { json: 'tick', js: 'tick', typ: u(undefined, 3.14) }, + { json: 'type', js: 'type', typ: u(undefined, 3.14) }, + ], + false + ), + PurpleProductSize: o( + [ + { json: 'increment', js: 'increment', typ: u(undefined, 3.14) }, + { json: 'max', js: 'max', typ: u(undefined, 3.14) }, + { json: 'min', js: 'min', typ: u(undefined, 3.14) }, + { json: 'type', js: 'type', typ: u(undefined, '') }, + ], + false + ), OrderList: o( [ { json: 'id', js: 'id', typ: u(undefined, m('')) }, @@ -2994,6 +3351,7 @@ const typeMap: any = { { json: 'details', js: 'details', typ: u(undefined, r('FluffyOrderDetails')) }, { json: 'id', js: 'id', typ: m('') }, { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'notes', js: 'notes', typ: u(undefined, '') }, { json: 'type', js: 'type', typ: r('OrderType') }, ], 'any' @@ -3046,13 +3404,66 @@ const typeMap: any = { ), Product: o( [ + { json: 'details', js: 'details', typ: u(undefined, r('FluffyProductDetails')) }, { json: 'id', js: 'id', typ: m('') }, { json: 'instrument', js: 'instrument', typ: u(undefined, r('InstrumentElement')) }, { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'notes', js: 'notes', typ: u(undefined, '') }, { json: 'type', js: 'type', typ: r('ProductType') }, ], 'any' ), + FluffyProductDetails: o( + [ + { json: 'description', js: 'description', typ: u(undefined, '') }, + { json: 'exchange', js: 'exchange', typ: u(undefined, '') }, + { json: 'legs', js: 'legs', typ: u(undefined, a(r('FluffyLeg'))) }, + { json: 'orderType', js: 'orderType', typ: u(undefined, r('OrderTypeEnum')) }, + { json: 'price', js: 'price', typ: u(undefined, r('FluffyProductPrice')) }, + { json: 'size', js: 'size', typ: u(undefined, r('FluffyProductSize')) }, + { json: 'structureType', js: 'structureType', typ: u(undefined, '') }, + ], + 'any' + ), + FluffyLeg: o( + [ + { json: 'expirationDate', js: 'expirationDate', typ: u(undefined, '') }, + { json: 'id', js: 'id', typ: u(undefined, '') }, + { json: 'maturityDate', js: 'maturityDate', typ: u(undefined, '') }, + { json: 'ratioQty', js: 'ratioQty', typ: u(undefined, 3.14) }, + { json: 'side', js: 'side', typ: r('Side') }, + { json: 'strikePrice', js: 'strikePrice', typ: 3.14 }, + { json: 'type', js: 'type', typ: r('OptionType') }, + ], + 'any' + ), + FluffyProductPrice: o( + [ + { json: 'tick', js: 'tick', typ: u(undefined, 3.14) }, + { json: 'type', js: 'type', typ: u(undefined, 3.14) }, + ], + false + ), + FluffyProductSize: o( + [ + { json: 'increment', js: 'increment', typ: u(undefined, 3.14) }, + { json: 'max', js: 'max', typ: u(undefined, 3.14) }, + { json: 'min', js: 'min', typ: u(undefined, 3.14) }, + { json: 'type', js: 'type', typ: u(undefined, '') }, + ], + false + ), + Rfq: o( + [ + { json: 'broker', js: 'broker', typ: u(undefined, '') }, + { json: 'id', js: 'id', typ: m('') }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'notes', js: 'notes', typ: u(undefined, '') }, + { json: 'product', js: 'product', typ: r('ProductObject') }, + { json: 'type', js: 'type', typ: r('RFQType') }, + ], + 'any' + ), TimeRange: o( [ { json: 'endTime', js: 'endTime', typ: u(undefined, Date) }, @@ -3067,6 +3478,7 @@ const typeMap: any = { [ { json: 'id', js: 'id', typ: m('') }, { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'notes', js: 'notes', typ: u(undefined, '') }, { json: 'product', js: 'product', typ: r('ProductObject') }, { json: 'type', js: 'type', typ: r('TradeType') }, ], @@ -3085,6 +3497,7 @@ const typeMap: any = { [ { json: 'id', js: 'id', typ: m('') }, { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'notes', js: 'notes', typ: u(undefined, '') }, { json: 'product', js: 'product', typ: r('ProductObject') }, { json: 'type', js: 'type', typ: r('TradeType') }, ], @@ -3137,12 +3550,30 @@ const typeMap: any = { InstrumentListType: ['fdc3.instrumentList'], InteractionType: ['fdc3.interaction'], NothingType: ['fdc3.nothing'], + Side: ['Buy', 'Sell'], + OptionType: ['Call', 'Put'], + OrderTypeEnum: [ + 'all-or-none', + 'buy-stop', + 'day', + 'fill-or-kill', + 'gtc', + 'iceberg', + 'immediate-or-cancel', + 'limit', + 'limit-sell', + 'market', + 'once-cancels-the-other', + 'stop', + 'stop-loss', + ], ProductType: ['fdc3.product'], OrderType: ['fdc3.order'], OrderListType: ['fdc3.orderList'], StickyInteractionType: ['fdc3.organization'], PositionType: ['fdc3.position'], PortfolioType: ['fdc3.portfolio'], + RFQType: ['fdc3.rfq'], TradeType: ['fdc3.trade'], TradeListType: ['fdc3.tradeList'], TransactionStatus: ['Created', 'Deleted', 'Failed', 'Updated'], diff --git a/packages/fdc3-context/schemas/context/order.schema.json b/packages/fdc3-context/schemas/context/order.schema.json index fcf975011..abc0c1a65 100644 --- a/packages/fdc3-context/schemas/context/order.schema.json +++ b/packages/fdc3-context/schemas/context/order.schema.json @@ -24,6 +24,11 @@ "title": "Name", "description": "An optional human-readable summary of the order." }, + "notes": { + "type": "string", + "title": "Notes", + "description": "A description or set of notes." + }, "details": { "type": "object", "title": "Order Details", @@ -48,6 +53,7 @@ { "type": "fdc3.order", "name": "...", + "notes": "Some notes attached to this order", "id": { "myOMS": "12345" }, diff --git a/packages/fdc3-context/schemas/context/product.schema.json b/packages/fdc3-context/schemas/context/product.schema.json index a6003dafe..9aceed53d 100644 --- a/packages/fdc3-context/schemas/context/product.schema.json +++ b/packages/fdc3-context/schemas/context/product.schema.json @@ -1,55 +1,231 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/context/product.schema.json", - "type": "object", - "title": "Product", - "description": "@experimental context type representing a tradable product. To be used with OMS and EMS systems.\n\nThis type is currently only loosely defined as an extensible context object, with an optional instrument field.\n\nThe Product schema does not explicitly include identifiers in the id section, as there is not a common standard for such identifiers. Applications can, however, populate this part of the contract with custom identifiers if so desired.", - "allOf": [ - { - "type": "object", - "properties": { - "type": { - "const": "fdc3.product" - }, - "id": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "Product Identifiers", - "description": "One or more identifiers that refer to the product. Specific key names for systems are expected to be standardized in future." - }, - "name": { - "type": "string", - "title": "Product Name", - "description": "A human-readable summary of the product." - }, - "instrument": { - "$ref": "instrument.schema.json", - "title": "Product Instrument", - "description": "A financial instrument that relates to the definition of this product" - } - }, - "required": [ - "type", - "id" - ], - "additionalProperties": true - }, - { "$ref": "context.schema.json#/definitions/BaseContext" } - ], - "examples": [ - { - "type": "fdc3.product", - "id": { - "productId": "ABC123" - }, - "instrument": { - "type": "fdc3.instrument", - "id": { - "ticker": "MSFT" - } - } - } - ] + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/context/product.schema.json", + "type": "object", + "title": "Product", + "description": "@experimental context type representing a tradable product. To be used with OMS and EMS systems.\n\nThis type is currently only loosely defined as an extensible context object, with an optional instrument field.\n\nThe Product schema does not explicitly include identifiers in the id section, as there is not a common standard for such identifiers. Applications can, however, populate this part of the contract with custom identifiers if so desired.", + "allOf": [ + { + "type": "object", + "properties": { + "type": { + "const": "fdc3.product" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Product Identifiers", + "description": "One or more identifiers that refer to the product. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Product Name", + "description": "A human-readable summary of the product." + }, + "notes": { + "type": "string", + "title": "Notes", + "description": "A description or set of notes." + }, + "instrument": { + "$ref": "instrument.schema.json", + "title": "Product Instrument", + "description": "A financial instrument that relates to the definition of this product" + }, + "details" : { + "type": "object", + "title": "Product Details", + "description": "Details that further define this product.", + "properties": { + "description": { + "type": "string", + "title": "Product Description", + "description": "A description of the product as a string mi the style often used by traders to describe products within a chat messaging system", + "examples": ["SPY CF W+ 20DEC24 580/590/600 1x2x1 r572.99 d13% (PHLX)"] + }, + "orderType": { + "type": "string", + "enum": ["market", "limit", "limit-sell", "buy-stop", "stop-loss", "stop", "day", "gtc", "iceberg", "once-cancels-the-other", "immediate-or-cancel", "all-or-none", "fill-or-kill"], + "title": "Order Type", + "description": "The type of order" + }, + "structureType": { + "type": "string", + "title": "Structure Type", + "description": "A description of the the structure or strategy of the product", + "examples": ["Call Fly Wing+"] + }, + "exchange": { + "type": "string", + "title": "Exchange", + "description": "The exchange or marketplace where the product is offered", + "examples": ["PHLX"] + }, + "size": { + "type": "object", + "title": "Product Size", + "description": "Logic used to determine the size, size limits and increments to use when trading the product.", + "properties": { + "min": { + "type": "number", + "title": "Minimum", + "description": "The minimum size" + }, + "max": { + "type": "number", + "title": "Maximum", + "description": "The maximum size" + }, + "increment": { + "type": "number", + "title": "Increment", + "description": "The amount to increment the size by" + }, + "type": { + "type": "string", + "title": "Size Type", + "description": "The" + } + }, + "required": [], + "additionalProperties": false + }, + "price": { + "type": "object", + "title": "Product Price", + "description": "Logic used to determine the size, size limits and increments to use when trading the product.", + "properties": { + "tick": { + "type": "number", + "title": "Tick", + "description": "" + }, + "type": { + "type": "number", + "title": "Price Type", + "description": "" + } + }, + "required": [], + "additionalProperties": false + }, + "legs": { + "type": "array", + "title": "Legs", + "description": "Description of the parts of a multi-part transaction.", + "items": { + "type": "object", + "title": "Leg", + "description": "A part of a multi-part transaction.", + "properties": { + "id": { + "type": "string", + "title": "", + "description": "Unique identifier for this order leg within the multi-leg order" + }, + "type": { + "type": "string", + "enum": ["Call", "Put"], + "title": "Option Type", + "description": "Indicates whether this Leg relates to a purchase or sale option." + }, + "expirationDate": { + "type": "string", + "format:": "date", + "title": "Expiration Date", + "description": "For options, the date at which the contract expires." + }, + "maturityDate": { + "type": "string", + "format:": "date", + "title": "Maturity Date", + "description": "The date on which the the issuer repays the holders." + }, + "strikePrice": { + "type": "number", + "title": "Strike Price", + "description": "The price at which the underlying asset is bought or sold" + }, + "ratioQty": { + "type": "number", + "title": "Ratio Quantity", + "description": "A 'per unit' quantity for the leg as a ratio of the order size." + }, + "side": { + "type": "string", + "enum": ["Buy", "Sell"], + "title": "Side", + "description": "Indicates whether the asset is being bought or sold." + } + }, + "required": ["type","strikePrice", "side"] + } + } + }, + "required": [], + "additionalProperties": true + } + }, + "required": [ + "type", + "id" + ], + "additionalProperties": true + }, + { "$ref": "context.schema.json#/definitions/BaseContext" } + ], + "examples": [ + { + "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, + "notes": "Some notes attached to this product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + }, + "details": { + "description": "SPY CF W+ 20DEC24 580/590/600 1x2x1 r572.99 d13% (PHLX)", + "structureType": "Call Fly Wing+", + "exchange": "PHLX", + "size": { + "min": 1000, + "increment": 100, + "type": "Lots" + }, + "price": { + "tick": 0.1, + "type": "Price" + }, + "legs": [ + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 580, + "ratioQty": 1, + "side": "Buy" + }, + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 590, + "ratioQty": -2, + "side": "Sell" + }, + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 600, + "ratioQty": 1, + "side": "Buy" + } + ] + } + } + ] } \ No newline at end of file diff --git a/packages/fdc3-context/schemas/context/rfq.schema.json b/packages/fdc3-context/schemas/context/rfq.schema.json new file mode 100644 index 000000000..36beb3f10 --- /dev/null +++ b/packages/fdc3-context/schemas/context/rfq.schema.json @@ -0,0 +1,112 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/context/rfq.schema.json", + "type": "object", + "title": "RFQ", + "description": "@experimental context type representing a Request For Quote (RFQ).", + "allOf": [ + { + "type": "object", + "properties": { + "type": { + "const": "fdc3.rfq" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "RFQ Identifiers", + "description": "One or more identifiers that refer to the RFQ in an OMS or related system. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Name", + "description": "An optional human-readable summary of the RFQ." + }, + "notes": { + "type": "string", + "title": "Notes", + "description": "A description or set of notes." + }, + "broker": { + "type": "string", + "title": "Broker", + "description": "" + }, + "product": { + "$ref": "product.schema.json", + "title": "Product Description", + "description": "Details of the order to be quoted for" + } + }, + "required": [ + "type", + "id", + "product" + ], + "additionalProperties": true + }, + { + "$ref": "context.schema.json#/definitions/BaseContext" + } + ], + "examples": [ + { + "type": "fdc3.rfq", + "id": { + "rfqId": "RFQ12345" + }, + "broker": "Broker ABC", + "product": { + "type": "fdc3.product", + "id": { + "productId": "SPY-CALLFLYWING+-20241220" + }, + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "SPY" + } + }, + "details": { + "description": "SPY CF W+ 20DEC24 580/590/600 1x2x1 r572.99 d13% (PHLX)", + "structureType": "Call Fly Wing+", + "exchange": "PHLX", + "size": { + "min": 1000, + "increment": 100, + "type": "Lots" + }, + "price": { + "tick": 0.1, + "type": "Price" + }, + "legs": [ + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 580, + "ratioQty": 1, + "side": "Buy" + }, + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 590, + "ratioQty": -2, + "side": "Sell" + }, + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 600, + "ratioQty": 1, + "side": "Buy" + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/packages/fdc3-context/schemas/context/trade.schema.json b/packages/fdc3-context/schemas/context/trade.schema.json index 771eea9c0..5c911d794 100644 --- a/packages/fdc3-context/schemas/context/trade.schema.json +++ b/packages/fdc3-context/schemas/context/trade.schema.json @@ -1,61 +1,67 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/context/trade.schema.json", - "type": "object", - "title": "Trade", - "description": "@experimental context type representing a trade. To be used with execution systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the trade in one or more systems, an optional human readable `name` field to be used to summarize the trade and a required `product` field that may be used to provide additional detail about the trade, which is currently typed as a unspecified Context type, but `product` is expected to be standardized in future.\n\n The Trade schema does not explicitly include identifiers in the id section, as there is not a common standard for such identifiers. Applications can, however, populate this part of the contract with custom identifiers if so desired.", - "allOf": [ - { - "type": "object", - "properties": { - "type": { - "const": "fdc3.trade" - }, - "id": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "Trade Identifiers", - "description": "One or more identifiers that refer to the trade in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future." - }, - "name": { - "type": "string", - "title": "Trade Name", - "description": "A human-readable summary of the trade." - }, - "product": { - "$ref": "product.schema.json", - "title": "Traded product", - "description": "A product that is the subject of the trade." - } - }, - "required": [ - "type", "id", "product" - ], - "additionalProperties": true - }, - { "$ref": "context.schema.json#/definitions/BaseContext" } - ], - "examples": [ - { - "type": "fdc3.trade", - "name": "...", - "id": { - "myEMS": "12345" - }, - "product": { - "type": "fdc3.product", - "id": { - "productId": "ABC123" - }, - "instrument": { - "type": "fdc3.instrument", - "id": { - "ticker": "MSFT" - } - } - } - } - ] + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/context/trade.schema.json", + "type": "object", + "title": "Trade", + "description": "@experimental context type representing a trade. To be used with execution systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the trade in one or more systems, an optional human readable `name` field to be used to summarize the trade and a required `product` field that may be used to provide additional detail about the trade, which is currently typed as a unspecified Context type, but `product` is expected to be standardized in future.\n\n The Trade schema does not explicitly include identifiers in the id section, as there is not a common standard for such identifiers. Applications can, however, populate this part of the contract with custom identifiers if so desired.", + "allOf": [ + { + "type": "object", + "properties": { + "type": { + "const": "fdc3.trade" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Trade Identifiers", + "description": "One or more identifiers that refer to the trade in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Trade Name", + "description": "A human-readable summary of the trade." + }, + "notes": { + "type": "string", + "title": "Notes", + "description": "A description or set of notes." + }, + "product": { + "$ref": "product.schema.json", + "title": "Traded product", + "description": "A product that is the subject of the trade." + } + }, + "required": [ + "type", "id", "product" + ], + "additionalProperties": true + }, + { "$ref": "context.schema.json#/definitions/BaseContext" } + ], + "examples": [ + { + "type": "fdc3.trade", + "name": "...", + "notes": "Some notes attached to this trade", + "id": { + "myEMS": "12345" + }, + "product": { + "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + } + ] } diff --git a/toolbox/fdc3-workbench/eslint.config.mjs b/toolbox/fdc3-workbench/eslint.config.mjs index 835efa093..71ef26547 100644 --- a/toolbox/fdc3-workbench/eslint.config.mjs +++ b/toolbox/fdc3-workbench/eslint.config.mjs @@ -5,7 +5,6 @@ import { fixupPluginRules } from "@eslint/compat"; import globals from "globals"; import tsParser from "@typescript-eslint/parser"; import pluginJs from "@eslint/js"; -import tseslint from "typescript-eslint"; import eslintConfigPrettier from "eslint-config-prettier"; import path from "node:path"; import { fileURLToPath } from "node:url"; diff --git a/website/docs/context/ref/Order.md b/website/docs/context/ref/Order.md index 45bdfc2c6..5ec3968cd 100644 --- a/website/docs/context/ref/Order.md +++ b/website/docs/context/ref/Order.md @@ -45,6 +45,15 @@ An optional human-readable summary of the order. +
+ notes + +**type**: `string` + +A description or set of notes. + +
+
details @@ -69,6 +78,7 @@ Optional additional details about the order, which may include a product element { "type": "fdc3.order", "name": "...", + "notes": "Some notes attached to this order", "id": { "myOMS": "12345" }, diff --git a/website/docs/context/ref/Product.md b/website/docs/context/ref/Product.md index 1d988a89e..76d3276fc 100644 --- a/website/docs/context/ref/Product.md +++ b/website/docs/context/ref/Product.md @@ -47,6 +47,15 @@ A human-readable summary of the product.
+
+ notes + +**type**: `string` + +A description or set of notes. + +
+
instrument @@ -56,6 +65,221 @@ A financial instrument that relates to the definition of this product
+
+ details + +**type**: `object` + +**Subproperties:** + +
+ description + +**type**: `string` + +A description of the product as a string mi the style often used by traders to describe products within a chat messaging system + + +**Example**: + +```js +"SPY CF W+ 20DEC24 580/590/600 1x2x1 r572.99 d13% (PHLX)" +``` + +
+ +
+ orderType + +**type**: `string` with values: +- `market`, +- `limit`, +- `limit-sell`, +- `buy-stop`, +- `stop-loss`, +- `stop`, +- `day`, +- `gtc`, +- `iceberg`, +- `once-cancels-the-other`, +- `immediate-or-cancel`, +- `all-or-none`, +- `fill-or-kill` + +The type of order + +
+ +
+ structureType + +**type**: `string` + +A description of the the structure or strategy of the product + + +**Example**: + +```js +"Call Fly Wing+" +``` + +
+ +
+ exchange + +**type**: `string` + +The exchange or marketplace where the product is offered + + +**Example**: + +```js +"PHLX" +``` + +
+ +
+ size + +**type**: `object` + +**Subproperties:** + +
+ min + +**type**: `number` + +The minimum size + +
+ +
+ max + +**type**: `number` + +The maximum size + +
+ +
+ increment + +**type**: `number` + +The amount to increment the size by + +
+ +Logic used to determine the size, size limits and increments to use when trading the product. + +
+ +
+ price + +**type**: `object` + +**Subproperties:** + +
+ tick + +**type**: `number` + + + +
+ +Logic used to determine the size, size limits and increments to use when trading the product. + +
+ +
+ legs + +**type**: `array` + +
+ Items + +**type**: `object` + +**Subproperties:** + +
+ id + +**type**: `string` + +Unique identifier for this order leg within the multi-leg order + +
+ +
+ expirationDate + +**type**: `string` + +For options, the date at which the contract expires. + +
+ +
+ maturityDate + +**type**: `string` + +The date on which the the issuer repays the holders. + +
+ +
+ strikePrice (required) + +**type**: `number` + +The price at which the underlying asset is bought or sold + +
+ +
+ ratioQty + +**type**: `number` + +A 'per unit' quantity for the leg as a ratio of the order size. + +
+ +
+ side (required) + +**type**: `string` with values: +- `Buy`, +- `Sell` + +Indicates whether the asset is being bought or sold. + +
+ +A part of a multi-part transaction. + +
+ +Description of the parts of a multi-part transaction. + +
+ +Details that further define this product. + +
+ ## Example ```json @@ -64,11 +288,49 @@ A financial instrument that relates to the definition of this product "id": { "productId": "ABC123" }, + "notes": "Some notes attached to this product", "instrument": { "type": "fdc3.instrument", "id": { "ticker": "MSFT" } + }, + "details": { + "description": "SPY CF W+ 20DEC24 580/590/600 1x2x1 r572.99 d13% (PHLX)", + "structureType": "Call Fly Wing+", + "exchange": "PHLX", + "size": { + "min": 1000, + "increment": 100, + "type": "Lots" + }, + "price": { + "tick": 0.1, + "type": "Price" + }, + "legs": [ + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 580, + "ratioQty": 1, + "side": "Buy" + }, + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 590, + "ratioQty": -2, + "side": "Sell" + }, + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 600, + "ratioQty": 1, + "side": "Buy" + } + ] } } ``` diff --git a/website/docs/context/ref/RFQ.md b/website/docs/context/ref/RFQ.md new file mode 100644 index 000000000..5561a70fd --- /dev/null +++ b/website/docs/context/ref/RFQ.md @@ -0,0 +1,133 @@ +--- +title: RFQ +sidebar_label: RFQ + +--- + +# RFQ + +[@experimental](/docs/fdc3-compliance#experimental-features) context type representing a Request For Quote (RFQ). + +## Schema + +[https://fdc3.finos.org/schemas/next/context/rfq.schema.json](https://fdc3.finos.org/schemas/next/context/rfq.schema.json) ([github](https://github.com/finos/FDC3/tree/main/packages/fdc3-context/schemas/context/rfq.schema.json)) + +## Type + +`fdc3.rfq` + +## Properties + +
+ id (required) + +**type**: `object` + +
+ Additional Properties + +**type**: `string` + +
+ +One or more identifiers that refer to the RFQ in an OMS or related system. Specific key names for systems are expected to be standardized in future. + +
+ +
+ name + +**type**: `string` + +An optional human-readable summary of the RFQ. + +
+ +
+ notes + +**type**: `string` + +A description or set of notes. + +
+ +
+ broker + +**type**: `string` + + + +
+ +
+ product (required) + +**type**: [Product](Product) + +Details of the order to be quoted for + +
+ +## Example + +```json +{ + "type": "fdc3.rfq", + "id": { + "rfqId": "RFQ12345" + }, + "broker": "Broker ABC", + "product": { + "type": "fdc3.product", + "id": { + "productId": "SPY-CALLFLYWING+-20241220" + }, + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "SPY" + } + }, + "details": { + "description": "SPY CF W+ 20DEC24 580/590/600 1x2x1 r572.99 d13% (PHLX)", + "structureType": "Call Fly Wing+", + "exchange": "PHLX", + "size": { + "min": 1000, + "increment": 100, + "type": "Lots" + }, + "price": { + "tick": 0.1, + "type": "Price" + }, + "legs": [ + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 580, + "ratioQty": 1, + "side": "Buy" + }, + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 590, + "ratioQty": -2, + "side": "Sell" + }, + { + "type": "Call", + "maturityDate": "2024-12-20", + "strikePrice": 600, + "ratioQty": 1, + "side": "Buy" + } + ] + } + } +} +``` + diff --git a/website/docs/context/ref/Trade.md b/website/docs/context/ref/Trade.md index 9b60f4421..ac9c5569d 100644 --- a/website/docs/context/ref/Trade.md +++ b/website/docs/context/ref/Trade.md @@ -47,6 +47,15 @@ A human-readable summary of the trade. +
+ notes + +**type**: `string` + +A description or set of notes. + +
+
product (required) @@ -62,6 +71,7 @@ A product that is the subject of the trade. { "type": "fdc3.trade", "name": "...", + "notes": "Some notes attached to this trade", "id": { "myEMS": "12345" }, diff --git a/website/sidebars.json b/website/sidebars.json index b9303597f..68b68a8f1 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -111,6 +111,7 @@ "context/ref/Portfolio", "context/ref/Position", "context/ref/Product", + "context/ref/RFQ", "context/ref/TimeRange", "context/ref/Trade", "context/ref/TradeList",