x-internal: true # the resolved yaml is the public one on Stoplight since it (also, like the swagger editor) has issues rendering http referenced models openapi: 3.1.0 info: version: 4.40.0 title: MerQube API contact: name: API Support url: https://www.merqube.com/contact email: support@merqube.com description: MerQube APIs servers: - url: https://api.merqube.com description: Production server - url: https://api.staging.merqube.com description: Testing server for next generation features paths: /index: get: description: Get all MerQube indices. summary: Get all MerQube indices. operationId: index tags: - index parameters: - $ref: '#/components/parameters/filterParam' - $ref: '#/components/parameters/idsParam' - $ref: '#/components/parameters/nameParam' - $ref: '#/components/parameters/namesParam' - $ref: '#/components/parameters/namespaceParam' - $ref: '#/components/parameters/fieldsParam' - $ref: '#/components/parameters/debugParam' - $ref: '#/components/parameters/formatParam' - name: type in: query description: By default only "prod" indices are shown; comma delimited list of other "types" required: false schema: type: string example: test,prod - name: fetch_identifiers in: query description: will return an additional section, linked_resources, that contains all identifier objects that the calling user has permission to that are linked to this index required: false schema: type: string enum: - 'true' responses: '200': description: 200 response content: application/json: schema: type: object properties: results: type: array items: $ref: '#/components/schemas/IndexDefinitionPatchPutGet' error_codes: $ref: '#/components/schemas/ErrorCodes' post: description: Create a new MerQube index summary: Create a new MerQube index tags: - index requestBody: content: application/json: schema: oneOf: - $ref: '#/components/schemas/IndexDefinitionPost' - $ref: '#/components/schemas/CopyFromManifest' responses: '200': description: OK content: application/json: schema: type: object title: Index Creation Response Schema properties: id: type: string description: the uuid of this index security_id: type: string description: the uuid of the secapi (type index) security for this index intraday_security_id: type: string description: the uuid of the secapi (type intraday_index) security for this index status: type: string '400': description: illegal request body '403': description: not authorized to perform this operation /index/{uuid}: parameters: - $ref: '#/components/parameters/uuidParam' get: description: Returns the MerQube index with this uuid summary: Returns the MerQube index with this uuid operationId: index_uuid tags: - index responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/IndexDefinitionPatchPutGet' '403': description: not authorized to perform this operation '404': description: index does not exist put: description: Replace a MerQube index. summary: Replace a MerQube index tags: - index requestBody: content: application/json: schema: $ref: '#/components/schemas/IndexDefinitionPatchPutGet' responses: '200': description: OK '400': description: illegal request body '403': description: not authorized '404': description: index does not exist patch: description: Partialy update a MerQube index. summary: Partially update a MerQube index tags: - index requestBody: content: application/json: schema: type: object # TODO; problem here is, this would accept any fields from index def but none are required description: any fields from an Index Manifest responses: '200': description: OK '400': description: illegal request body '403': description: not authorized '404': description: index does not exist delete: description: Delete a MerQube index. Also tries to delete its identifiers. summary: Delete a MerQube index. tags: - index responses: '200': description: OK '403': description: not authorized '404': description: index does not exist /index/{uuid}/stats: get: description: Returns stats associated with a specific MerQube index summary: Returns stats associated with a specific MerQube index operationId: index_stats tags: - index parameters: - $ref: '#/components/parameters/uuidParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' - name: metric in: query description: 'Metric to compute stats on (default: total_return)' required: false schema: type: string responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/Stats' '403': description: not authorized to see this namespace '404': description: index does not exist /index/{uuid}/stats2: get: description: Returns stats associated with a specific MerQube index summary: Returns stats associated with a specific MerQube index operationId: index_stats tags: - index requestBody: content: application/json: schema: $ref: '#/components/schemas/StatsRequest' responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/StatsResponse' '403': description: not authorized to see this namespace '404': description: index does not exist /index/{uuid}/caps: get: description: Get the caps of buffer MerQube index summary: Get the caps of buffer MerQube index operationId: index_caps tags: - index parameters: - $ref: '#/components/parameters/uuidParam' - in: query name: base_symbol schema: type: string - in: query name: base_name schema: type: string - in: query name: base_plot_metric schema: type: string - $ref: '#/components/parameters/formatParam' responses: '200': description: 200 response content: application/json: schema: type: object properties: results: type: array items: type: object properties: id: type: string description: currently, the date example: '2019-07-20' date: type: string description: date example: '2019-07-20' caps: type: object description: object example: SPY: 0.9036144578 cap: 16.8152652821 performance: 0.9364820847 '403': description: not authorized to see this namespace '404': description: index or caps does not exist /index/{uuid}/portfolio: get: description: Get the portfolio of a MerQube index over time summary: Get the portfolio of a MerQube index over time operationId: index_portfolio tags: - index parameters: - $ref: '#/components/parameters/uuidParam' - name: dates_only in: query description: include only dates and no portfolio data required: false schema: type: string enum: - 'true' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' - in: query name: time schema: type: string format: date-time - in: query name: download schema: type: string description: either true or false responses: '200': description: 200 response content: application/json: schema: type: object properties: results: type: array items: type: object properties: id: type: string description: currently, the date example: '2005-07-15T00:00:00' date: type: string description: date example: '2005-07-15T00:00:00' portfolio: type: object description: object where each key is a holding example: OPTION:SPY:CALL:0.0:2006-07-21:BUY: buy_sell: BUY exchgcntry: US exercise_type: European expiry: '2006-07-21' mic: XCME option_type: CALL price: 120.31612463831256 price_date: '2005-07-15' root: SPY shares: 8.143322475570033 strike: '0.0' strike_percentage: 0 symbol: OPTION:SPY:CALL:0.0:2006-07-21:BUY weight: 8.143322475570033 OPTION:SPY:CALL:143.4491457664114:2006-07-21:SELL: buy_sell: SELL exchgcntry: US exercise_type: European expiry: '2006-07-21' mic: XCME option_type: CALL price: 0.5857132916126346 price_date: '2005-07-15' root: SPY shares: -8.143322475570033 strike: '143.4491457664114' strike_percentage: 116.81526528209396 symbol: OPTION:SPY:CALL:143.4491457664114:2006-07-21:SELL weight: 8.143322 475570033 '400': description: illegal query arg value (e.g., time is not a date-time) '403': description: not authorized '404': description: index or portfolio does not exist /index/{uuid}/portfolio_allocations: get: description: Get the allocations of a MerQube index summary: Get the allocations of a MerQube index operationId: index_portfolio_allocations tags: - index parameters: - $ref: '#/components/parameters/uuidParam' responses: '200': description: 200 response content: application/json: schema: type: object properties: results: type: array items: type: object properties: id: type: string description: currently, the date example: '2005-07-15T00:00:00' date: type: string description: date example: '2005-07-15T00:00:00' portfolio: type: object description: object example: OPTION:SPY:CALL:0.0:2006-07-21:BUY: 8.143322475570033, OPTION:SPY:CALL:0.0:2007-07-20:BUY: null, 'OPTION: SPY:PUT:116.66:2006-07-21:BUY': 8.143322475570033, '403': description: not authorized to see this namespace '404': description: index or portfolio does not exist /index/{uuid}/target_portfolio: get: description: get the timeseries of target portfolios for an index tags: - index parameters: - $ref: '#/components/parameters/uuidParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' - name: statuses in: path description: a comma seperated list of portfolio statuses to filter by required: false schema: type: string default: FINAL responses: '200': description: OK content: application/json: schema: type: object properties: results: type: array items: type: object properties: eff_ts: $ref: '#/components/schemas/IsoTS' target_portfolio: $ref: '#/components/schemas/BasketPortfolio' '403': description: not authorized to see this namespace '404': description: index or portfolio does not exist put: description: replace the portfolio for this index. Will eventually but not immediately affect /index/uuid/portfolio. tags: - index parameters: - $ref: '#/components/parameters/uuidParam' requestBody: content: application/json: schema: $ref: '#/components/schemas/BasketPortfolioPutIn' responses: '200': description: OK, portfolio successfully written and validated. '400': description: bad portfolio or request '403': description: not authorized '404': description: index does not exist /index/{uuid}/target_portfolio/{target_portfolio_uuid}: get: description: Get an existing target portfolio tags: - index responses: '200': description: OK, portfolio successfully retrieved content: application/json: schema: type: object properties: eff_ts: $ref: '#/components/schemas/IsoTS' target_portfolio: $ref: '#/components/schemas/BasketPortfolio' '400': description: Bad request '403': description: Not authorized '404': description: Index or target portfolio does not exist patch: description: Update an existing target portfolio tags: - index requestBody: content: application/json: schema: $ref: '#/components/schemas/BasketPortfolioPatchIn' responses: '200': description: OK, portfolio successfully updated content: application/json: schema: $ref: '#/components/schemas/BasketPortfolio' '400': description: Bad request '403': description: Not authorized '404': description: Index or target portfolio does not exist delete: description: Deletes an existing target portfolio tags: - index responses: '200': description: OK, target_portfolio deleted '403': description: Not authorized '404': description: Index or target_portfolio with the provided UUIDs does not exist /index/{uuid}/data_collections: get: description: get the timeseries of data collections for an index tags: - index parameters: - $ref: '#/components/parameters/uuidParam' responses: '200': description: OK content: application/json: schema: # Not strictly enforced due to transformation. Enforcement handled by put. $ref: '#/components/schemas/ListDataCollections' type: object additionalProperties: true properties: data_collection: $ref: '#/components/schemas/DataCollectionsSpec' '403': description: not authorized to see this namespace '404': description: index or data collection does not exist put: description: create or replace the data collection specification for this index tags: - index parameters: - $ref: '#/components/parameters/uuidParam' requestBody: content: application/json: schema: type: object properties: data_collections: type: array items: $ref: '#/components/schemas/DataCollectionsSpec' responses: '200': description: OK, data collection successfully written and validated. '400': description: bad data collection or request '403': description: not authorized '404': description: index does not exist /index/{uuid}/data_collections/raw: get: description: Get a presigned raw file redirect for s3 tags: - index parameters: - $ref: '#/components/parameters/uuidParam' - $ref: '#/components/parameters/dataCollectionsNameParam' responses: '302': description: Moved /index/{uuid}/run_state: get: description: get the latest run state of the index. May be enhanced in the future to support quering for a given eff_ts (e.g., historically). tags: - index parameters: - $ref: '#/components/parameters/uuidParam' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/RunState' '403': description: not authorized to see this index namespace '404': description: index or does not exist /index/{uuid}/data_collections/data: get: description: fetch the data collections from s3 tags: - index parameters: - $ref: '#/components/parameters/uuidParam' - $ref: '#/components/parameters/dataCollectionsNameParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array description: Dynamic, depends on the data collection csv. '400': description: a required query param is missing '403': description: not authorized to see this namespace '404': description: index or data collection does not exist '409': description: Metadata consistency -- malformed s3 URI, or invalid date col /index-documents: get: tags: - index description: List of index documents parameters: - in: query name: id description: UUID of the index. Optional for index-specific documents. required: false schema: type: string responses: '200': description: Returned list of valid documents in bucket content: application/json: schema: type: object properties: results: type: array schema: type: object properties: filename: type: string shared: description: If this file is shared by multiple indices or not type: boolean last_modified: description: UTC ISO timestamp when file was last modified $ref: '#/components/schemas/IsoTS' put: tags: - index description: Upload a document for an index parameters: - in: query name: id description: UUID of the index. Optional for index-specific documents. required: false schema: type: string - in: query name: force_overwrite description: Overwrite a document required: false schema: type: boolean default: false requestBody: content: multipart/form-data: schema: type: object properties: document: type: string format: binary responses: '200': description: OK status of upload content: application/json: schema: type: object properties: status: type: string '400': description: Invalid multipart request, or file exists and requires overwrite flag. index/{uuid}/identifier/{identifier_uuid}: delete: description: Delete an identifier from an index tags: - index parameters: - $ref: '#/components/parameters/uuidParam' - $ref: '#/components/parameters/identifierParam' responses: '200': description: OK '403': description: not authorized '404': description: index or identifier does not exist index/{uuid}/identifier/{provider}/{identifier_name}: delete: description: Delete an identifier from an index tags: - index parameters: - $ref: '#/components/parameters/uuidParam' - $ref: '#/components/parameters/providerParam' - $ref: '#/components/parameters/identifierNameParam' responses: '200': description: OK '403': description: not authorized '404': description: index or identifier does not exist index/{uuid}/identifier/{provider}: post: description: Add an identifier to an index tags: - index parameters: - $ref: '#/components/parameters/uuidParam' - $ref: '#/components/parameters/providerParam' requestBody: content: application/json: schema: - $ref: '#/components/schemas/IndexIdentifierUUIDPost' responses: '200': description: OK '400': description: bad request '403': description: not authorized '404': description: index does not exist /index/{uuid}/documents: get: tags: - index description: Get documentation for an index parameters: - $ref: '#/components/parameters/uuidParam' - in: query name: document_type description: Document key in the index manifest which contains the file name. Defaults to "methodology". required: false schema: type: string default: methodology responses: '200': description: File found and returning presigned url to file content: application/json: schema: type: object properties: url: type: string '400': description: No documents found in the index manifest, or invalid document type '403': description: not authorized to see this namespace '404': description: Document not found # LEGACY equity secs /security/equity_legacy/{secname}/metrics: get: description: Get the metrics defined for a security summary: Get the metrics defined for a security operationId: security_metrics_defs tags: - legacy_equity_security parameters: - $ref: '#/components/parameters/secnameParam' responses: '200': description: 200 response content: application/json: schema: type: object properties: results: type: array items: $ref: '#/components/schemas/MetricsDef' '403': description: not authorized '404': description: security does not exist /security/equity_legacy/{secname}/metrics/{name}: get: description: Get a metrics definition for a security summary: Get a metrics definition for a security operationId: security_metrics_def tags: - legacy_equity_security parameters: - $ref: '#/components/parameters/secnameParam' - in: path required: true name: name schema: type: string description: name of metric responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/MetricsDef' '403': description: not authorized '404': description: security does not exist /security/equity_legacy/{secname}/metrics/{name}/data: get: description: Get the metrics timeseries of a MerQube security summary: Get the metrics timeseries of a MerQube security operationId: security_metrics tags: - legacy_equity_security parameters: - name: secname in: path description: name of the security for which the data is requested required: true schema: type: string - in: path required: true name: name schema: type: string description: name of metric - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' responses: '200': description: 200 response content: application/json: schema: type: object properties: results: type: array items: $ref: '#/components/schemas/Metrics' '400': description: bad metric requested '404': description: security does not exist /security/equity_legacy/{secname}/stats: get: description: Returns stats associated with a specific MerQube security summary: Returns stats associated with a specific MerQube security operationId: secstats tags: - legacy_equity_security parameters: - $ref: '#/components/parameters/secnameParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' - name: metric in: query description: 'Metric to compute stats on (default: total_return)' required: false schema: type: string - $ref: '#/components/parameters/formatParam' responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/Stats' '403': description: not authorized to see this namespace '404': description: index does not exist # Secapi /security: get: description: Returns the list of security types (note - equity is not currently under this) summary: Returns the list of security types tags: - security responses: '200': description: list of security types content: application/json: schema: type: array items: type: object properties: name: type: string /security/{type}: parameters: - $ref: '#/components/parameters/sectypeParam' post: description: Insert new securities summary: Insert new securities tags: - security requestBody: description: some of this is a WIP RE initial metrics etc. Making a contract may have fields rem content: application/json: schema: $ref: '#/components/schemas/NewSecurity' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/SecurityCreationResponse' '400': description: bad request '403': description: unauthorized '409': description: duplicate, e.g., name already exists get: description: get one or more metrics for one or more securities summary: get one or more metrics for one or more securities tags: - security parameters: - $ref: '#/components/parameters/nameParam' - $ref: '#/components/parameters/namesParam' - in: query name: id schema: type: string description: single id to pull - $ref: '#/components/parameters/idsParam' - in: query name: metrics schema: type: string description: comma delimited list of metrics example: Level,Portfolio - in: query name: securityfilter schema: type: string description: | a tiny query language that allows filtering securities by their metric values. For example, 'get all futures contracts with expiry < x and root == Y'. This is not a row-level filter. This is intended for 'metadata' like metrics and not for metrics with many values, as the results could be surprising. For example, 'get me prices for this week for all stocks that have ever closed above 1000' will contain this weeks results, and those prices may be < 1000; however, given this filter, those stocks *at one point* closed > 1000. Parenthesis and logicl ors between clauses are not currently supported. An arbitrary number of and clauses is supported, and or within a clause is supported, IE 'root = X or Y' The supported value oeprators are '!=', '==', '>=', '<=', '<', '>' The first parsed operator in each `^` seperated clause is used as the operator - no additional checking is performed, so something like `==<=` will be parsed as "is equal to `<=`" which is probably not what you want (and is likely to return an empty result set). The supported logical operators are '^' (and, since & conflicts with URL query args) and ',' (or) When the target value is a list (contains ','), the only two valid operators are != and ==. IE you cannot use <=X,Y etc. When the operator is '==' and the value is '*', it means "the security has this metric defined at least once" (ie, we don't care about the value, just that the row exists) Examples - futures_contract...&securityfilter=root==BTC,B6 - all contracts with root euql to BTC or B6 futures_contract...&securityfilter=root==BTC^expiry.merq>=2022-01-01T00:00:00 - all contracts with BTC root expiring in 2022 or later futures_root...&securityfilter=cme_limit_scaling_factor!=1.0 - all roots with a special/custom scaling factor such as cents It can also replace the names= parameter, e.g., futures_root...&securityfilter=name==A6,B6 - get the roots named either A6 or B6 (returns 2 records) - in: query name: namespace schema: type: string description: only return securities in this namespace example: mybank - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' - $ref: '#/components/parameters/formatParam' - name: as_of in: query description: view the database as_of a certain timestamp; data corrections that were backdated but inserted after this timestamp are ignored schema: description: should be a date-time as a string; YYYY-mm-dd HH-mm-ss type: string - name: since in: query description: view only data that was received since this timestamp. Note that because data could be corrected for previous days (eff_ts), this does not necessarily mean that eff_ts >= the since date. This will obtain data that was known about on or after the since date, but that data could be a correction for previous days. schema: description: should be a date-time as a string; YYYY-mm-dd HH-mm-ss type: string - name: raw in: query description: only applies when format!=csv. Includes additional information about the raw security api records, such as the provider timestamp and the source of the data. This is an employee only feature. schema: type: boolean - name: show_full_history in: query description: Shows the full history of records including corrected records (that is, no `max(prov_ts)`)). This is an employee only feature. Also implies raw=true automatically. NOTE, this breaks the typical unique index of `id/eff_ts/metric` because if there were corrections, the metric may have changed multiple times - the new unique index includes `prov_ts` in this case. schema: type: boolean - name: debug in: query description: turns on debugging information by injecting a debug section at the top level required: false schema: type: string enum: - 'true' - name: validated_only in: query description: Only return records that have been validated by internal data quality system. Defaults to false schema: type: boolean responses: '200': description: ok content: application/json: schema: type: object properties: results: type: array items: $ref: '#/components/schemas/SecurityMetrics' error_codes: $ref: '#/components/schemas/ErrorCodes' text/csv: example: ts,index,Level,Portfolio 2021-07-21T00:00:00,XXX,1,[...] '403': description: not authorized /security/{type}/data: post: description: Insert new security metrics summary: Insert new security metrics tags: - security parameters: - $ref: '#/components/parameters/sectypeParam' requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/SecurityMetrics' responses: '200': description: ok '400': description: data in request body is malformed or not of the expected format '403': description: not authorized /security/{type}/data/delete: post: description: | Mark existing security metrics as deleted - not really RESTful, more of an RPC endpoint, that allows the bulk (soft) deletion of records. Records are not hard-deleted; as in "as_of" queries are preserved, but they are marked with a sentinel that causes them not to be served with more recent or non-as of queries. Note - if the goal is to insert *a correction* - as in, there *should be a metric for this id/eff_ts, but the current value is wrong*, this method is NOT for that case. That case should be handled by doing a normal insert with a higher prov_ts. This delete is for the case where data should not have existed (or "was NULL") for an eff_ts as known by a given prov_ts. Prov_ts is optional on this method. If prov_ts is supplied, the deletion will take effect if theres no data with a higher prov_ts, but will not take effect if new inserts have a higher prov_ts. This [optional] acceptance of prov_ts is to support replaying data in any order, where data is added at prov_ts1, deleted at at prov_ts2, but then re-added (After the delete) by the provider at prov_ts3 - we want the results to be consistent regardless of what order these are replayed in. If prov_ts is not supplied, it is set to episolon greater than the current max prov_ts, and will take effect until newer data with a higher prov_ts comes in. It is reccomended that prov_ts is supplied unless the goal is absolutely to null out whatever the latest value is. summary: Mark existing security metrics as deprecated tags: - security parameters: - $ref: '#/components/parameters/sectypeParam' requestBody: content: application/json: schema: type: object required: - records properties: records: type: array items: $ref: '#/components/schemas/SecurityMetricsDeletion' responses: '200': description: ok content: application/json: schema: type: object properties: successful_deletions: type: number '400': description: data in request body is malformed or not of the expected format '403': description: not authorized /security/{type}/metrics: get: description: Get the metrics defined for a set of securities, however this only currently supports getting exactly one by name - more to come. That is, this allows you to query the metric definitions of a security by name rather than by id. summary: Get the metrics defined for a set of securities tags: - security parameters: - $ref: '#/components/parameters/sectypeParam' - $ref: '#/components/parameters/nameParam' responses: '200': description: 200 response content: application/json: schema: type: array items: $ref: '#/components/schemas/MetricsSchema' /security/{type}/{secid}: delete: description: Delete a security. It can be remade with the same name after - but this destroys all metrics, and as_of and since. summary: Delete a security tags: - security parameters: - $ref: '#/components/parameters/sectypeParam' - name: secid in: path description: id of the security for which the data is requested required: true schema: type: string responses: '200': description: 200 response '403': description: not authorized '404': description: security does not exist /security/{type}/{secid}/metrics: get: description: Get the metrics defined for a given security by id summary: Get the metrics defined for a givenn security by id tags: - security parameters: - $ref: '#/components/parameters/sectypeParam' - name: secid in: path description: id of the security for which the data is requested required: true schema: type: string responses: '200': description: 200 response content: application/json: schema: type: array items: $ref: '#/components/schemas/MetricsSchema' '403': description: not authorized '404': description: security does not exist # identifiers /identifier: get: description: return all currently supported identifier types summary: return all currently supported identifier types tags: - identifier responses: '200': description: 200 response content: application/json: schema: type: array items: type: string /identifier/{provider}: parameters: - $ref: '#/components/parameters/providerParam' get: description: Get all identifiers for this provider summary: Get all identifiers for this provider tags: - identifier parameters: - $ref: '#/components/parameters/filterParam' - $ref: '#/components/parameters/idsParam' - $ref: '#/components/parameters/nameParam' - $ref: '#/components/parameters/namesParam' - $ref: '#/components/parameters/namespaceParam' - $ref: '#/components/parameters/fieldsParam' - $ref: '#/components/parameters/debugParam' - $ref: '#/components/parameters/formatParam' responses: '200': description: 200 response content: application/json: schema: type: object properties: results: type: array items: $ref: '#/components/schemas/IdentifierUUIDPatchPutGet' error_codes: $ref: '#/components/schemas/ErrorCodes' post: description: Create a new identifier for this provider summary: Create a new identifier for this provider tags: - identifier requestBody: content: application/json: schema: $ref: '#/components/schemas/IdentifierUUIDPost' responses: '200': description: OK content: application/json: schema: type: object properties: id: type: string description: the uuid of this identifier status: type: string '400': description: illegal request body '403': description: not authorized to perform this operation /identifier/{provider}/{uuid}: parameters: - $ref: '#/components/parameters/providerParam' - $ref: '#/components/parameters/uuidParam' get: description: Returns the identifier for this provider with this uuid summary: Returns the identifier for this provider with this uuid tags: - identifier responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/IdentifierUUIDPatchPutGet' '403': description: not authorized to perform this operation '404': description: identifier does not exist put: description: Replace an identifier for this provider summary: Replace an identifier for this provider tags: - identifier requestBody: content: application/json: schema: $ref: '#/components/schemas/IdentifierUUIDPatchPutGet' responses: '200': description: OK '400': description: illegal request body '403': description: not authorized '404': description: identifier does not exist patch: description: Partialy update an identifier for this provider summary: Partially update an identifier for this provider tags: - identifier requestBody: content: application/json: schema: type: object description: any fields from an identifier Manifest responses: '200': description: OK '400': description: illegal request body '403': description: not authorized '404': description: identifier does not exist delete: description: Delete an identifier for this provider summary: Delete an identifier for this provider tags: - identifier responses: '200': description: OK '403': description: not authorized '404': description: identifier does not exist # security list /security_list: get: description: Get all MerQube security_lists. summary: Get all MerQube security_lists. tags: - security_list parameters: - $ref: '#/components/parameters/filterParam' - $ref: '#/components/parameters/idsParam' - $ref: '#/components/parameters/nameParam' - $ref: '#/components/parameters/namesParam' - $ref: '#/components/parameters/namespaceParam' - $ref: '#/components/parameters/fieldsParam' - $ref: '#/components/parameters/debugParam' - $ref: '#/components/parameters/formatParam' responses: '200': description: 200 response content: application/json: schema: type: object properties: results: type: array items: $ref: '#/components/schemas/SecurityListPatchPutGet' error_codes: $ref: '#/components/schemas/ErrorCodes' post: description: Create a new MerQube security_list summary: Create a new MerQube security_list tags: - security_list requestBody: content: application/json: schema: $ref: '#/components/schemas/SecurityListPost' responses: '200': description: OK content: application/json: schema: type: object properties: id: type: string description: the uuid of this security_list status: type: string '400': description: illegal request body '403': description: not authorized to perform this operation /security_list/{uuid}: parameters: - $ref: '#/components/parameters/uuidParam' get: description: Returns the MerQube security_list with this uuid summary: Returns the MerQube security_list with this uuid tags: - security_list responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/SecurityListPatchPutGet' '403': description: not authorized to perform this operation '404': description: security_list does not exist put: description: Replace a MerQube security_list. summary: Replace a MerQube security_list tags: - security_list requestBody: content: application/json: schema: $ref: '#/components/schemas/SecurityListPatchPutGet' responses: '200': description: OK '400': description: illegal request body '403': description: not authorized '404': description: security_list does not exist patch: description: Partialy update a MerQube security_list. summary: Partially update a MerQube security_list tags: - security_list requestBody: content: application/json: schema: type: object # TODO; problem here is, this would accept any fields from security_list def but none are required description: any fields from an security_list Manifest responses: '200': description: OK '400': description: illegal request body '403': description: not authorized '404': description: security_list does not exist delete: description: Delete a MerQube security_list. summary: Delete a MerQube security_list. tags: - security_list responses: '200': description: OK '403': description: not authorized '404': description: security_list does not exist /helper/index-template/static_basket: post: description: Generate a full static basket index manifest (does not create an index!) summary: Generate a full static basket index manifest (does not create an index!) operationId: helper_template_sstr tags: - helper requestBody: content: application/json: schema: $ref: '#/components/schemas/ClientStaticBasketConfig' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body /helper/index-template/sstr: post: description: Generate a full single stock total return index manifest (does not create an index!) summary: Generate a full single stock total return index manifest (does not create an index!) operationId: helper_template_sstr tags: - helper requestBody: content: application/json: schema: $ref: '#/components/schemas/ClientSSTRConfig' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body /helper/index-template/decrement: post: description: Generate a full single stock total return decrement overlay index manifest (does not create an index!) summary: Generate a full single stock total return decrement overlay index manifest (does not create an index!) operationId: helper_template_decrement tags: - helper requestBody: content: application/json: schema: $ref: '#/components/schemas/ClientDecrementConfig' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body /helper/index-template/multi_eb: post: description: Generate a full equity basket index manifest (does not create an index!) summary: Generate a full equity basket index manifest (does not create an index!) operationId: helper_template_multieb tags: - helper requestBody: content: application/json: schema: $ref: '#/components/schemas/ClientMultiEBConfig' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body /helper/index-template/multi_eb_portfolios: post: description: Generate a proper POST to target_portfolio - the same two inputs (constituents and levels) as multi_eb, except used to just update the portfolio of an existing index. This is included in template/multi_eb. summary: Generate a proper POST to target_portfolio - the same two inputs (constituents and levels) as multi_eb, except used to just update the portfolio of an existing index. This is included in template/multi_eb. operationId: helper_template_multieb_ports tags: - helper requestBody: content: application/json: schema: $ref: '#/components/schemas/ClientMultiEBPortUpdate' responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body # Options /helper/index-template/buffer_simple: post: description: Generate a buffer index summary: Generate a buffer index operationId: helper_template_buffer tags: - helper requestBody: content: application/json: schema: $ref: '#/components/schemas/ClientBufferConfig' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body /helper/index-template/single_option: post: description: Generate a single option index summary: Generate a single option index operationId: helper_template_single_option tags: - helper requestBody: content: application/json: schema: $ref: '#/components/schemas/ClientSingleOptionConfig' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body /helper/index-template/option_strategies: post: description: Generate a Option Strategies Index summary: Generate a Option Strategies Index operationId: helper_template_option_strategies tags: - helper requestBody: content: application/json: schema: $ref: '#/components/schemas/ClientOptionStrategiesConfig' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body /helper/index-template/defined_outcome: post: description: Generate a Defined Outcome Options Index summary: Generate a Defined Outcome Optons Index operationId: helper_template_defined_outcome tags: - helper requestBody: content: application/json: schema: oneOf: - $ref: '#/components/schemas/ClientDefinedOutcomeBufferConfig' # Define more stuff here - $ref: '#/components/schemas/ClientDefinedOutcomeAcceleratorConfig' - $ref: '#/components/schemas/ClientDefinedOutcomeCustomStrategyConfig' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body /helper/index-template/equity_index: post: description: Generate a Generalized Equity Index summary: Generate a Generalized Equity Index operationId: helper_template_equity_index tags: - helper requestBody: content: application/json: schema: $ref: '#/components/schemas/ClientEquityIndexConfig' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body /helper/index-template/vol_target: post: description: Generate a Vol Target Index summary: Generate a Vol Target Index operationId: helper_template_vol_target tags: - helper requestBody: content: application/json: # For now leave undefined but eventually either copy types from IPA lib, or have lookup IPA openapi.yaml schema: {} responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ClientTemplateResponse' '400': description: illegal request body /helper/solver/defined_outcome: post: description: Solve for the options prices and variable leg of a Defined Outcome Options Index summary: Solve for the options prices and variable leg of a Defined Outcome Options Index operationId: helper_solver_defined_outcome tags: - helper requestBody: content: application/json: schema: $ref: '#/components/schemas/DefinedOutcomeSolverRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/DefinedOutcomeSolverResponse' '400': description: illegal request body /helper/options_underlier: get: description: Returns all the allowed options underlier for the caller summary: Returns all the allowed options underlier for the caller tags: - helper responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/OptionsUnderlierGet' '403': description: not authorized to perform this operation /helper/index/run-states: get: description: Returns the latest index run states for the uuids provided. if no uuids provided will return all summary: Return the latest index run states for the uuids provided tags: - helper parameters: - $ref: '#/components/parameters/indexUuidsParam' - $ref: '#/components/parameters/pageParam' - $ref: '#/components/parameters/pageSizeParam' responses: '200': description: 200 response content: application/json: schema: type: object /api: get: description: serves this api in json format tags: - api responses: '200': description: 200 response content: application/json: schema: type: object /optionprice: servers: - url: https://api.merqurian.com post: description: MERQUBE OPTIONPRICE API returns the price of a custom option, the implied volatility (vol), implied interest rate (interest_rate), implied dividend yield (dividend_yield), and the option greeks (delta, vega, theta, and gamma). The API requires the underlying (root), date on which the pricing is desired (asofdate), strike of the custom option (strike), expiration (expiry), the type of the option (otype) [Put/Call], and the exercise type (etype)[European/American]. operationId: get_option_price responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/OptionResponse' summary: Custom option pricer tags: - options requestBody: content: application/json: schema: type: object required: - root - strike - asofdate - expiry - otype - etype properties: root: type: string enum: - SPY - TLT - QQQ - IWM description: Code for the underlying instrument on which the option is priced. etype: description: The option exercise type is either “European”, which can only be exercised at expiration, or “American”, which can be exercised at any time up to and including the expiration date. enum: - European - American type: string asofdate: type: string format: date example: 2020-05-26T00:00:00Z description: The date as of which the price of the option is being requested. Any date between 01-10-2005 and the most recent trading date of the underlying asset. expiry: type: string format: date example: 2021-02-15T00:00:00Z description: The expiry or expiration date is the date on which the options contract expires. Any date between 01-10-2005 and the expiration date of the longest dated options series on the given underlying asset. strike: type: number format: number example: 300 description: Strike of the option being priced. Any number greater than zero. otype: type: string enum: - put - call description: The option type refers to whether an option is a put option or a call option. extrapolation_days: type: integer default: 0 example: 0 description: This parameter allows the pricing of the option to use an implied dividend schedule to be moved forward by the number of days specified in this parameter. Any number greater than or equal to zero. Default value is zero. scale_dividend: type: number format: number default: 1 example: 1 description: Allows all of the dividends in the implied dividend schedule to be scaled by this input parameter. Any number greater than zero and less than 5. Default value is one. volatility_shift: type: number format: number default: 0 example: 0 description: Allows the user to change the implied volatility that is used to compute the price of the option (calculated from the volatility surface) by adding the input value to the one computed. For example, if the parameter provided is 0.1, the implied volatility used to calculate the option price would add 10% to the implied volatility calculated internally from the volatility surface. Number between -0.25 and 0.25, default value of zero. request_id: type: string description: This request id is returned back to the sender in the response description: Parameters for the option to price required: true /findstrike: servers: - url: https://api.merqurian.com post: description: MERQUBE FINDSTRIKE API returns the strike of a custom option given the underlying (root), the budget (cost of the option for which the strike is desired), date on which the strike price is desired (asofdate), expiration date of the option (expiry), and the type of the option (otype) [Put/Call], and the exercise type (etype)[European/American]. The API response contains the parameter strike which provides the strike of the option for the given budget. operationId: find_strike_for_given_budget responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/FindStrikeResponse' summary: Given budget and other criteria, find strike price tags: - options requestBody: content: application/json: schema: type: object required: - root - budget - asofdate - expiry - otype - etype properties: root: type: string enum: - SPY - TLT - QQQ - IWM description: Code for the underlying instrument on which the option is priced. etype: description: The option exercise type is either “European”, which can only be exercised at expiration, or “American”, which can be exercised at any time up to and including the expiration date. enum: - European - American type: string asofdate: type: string format: date example: 2020-05-26T00:00:00Z description: The date as of which the price of the option is being requested. Any date between 01-10-2005 and the most recent trading date of the underlying asset. expiry: type: string format: date example: 2021-02-15T00:00:00Z description: The expiry or expiration date is the date on which the options contract expires. Any date between 01-10-2005 and the expiration date of the longest dated options series on the given underlying asset. budget: type: number format: number example: 3.1 otype: type: string enum: - put - call description: The option type refers to whether an option is a put option or a call option. extrapolation_days: type: integer default: 0 example: 0 description: This parameter allows the pricing of the option to use an implied dividend schedule to be moved forward by the number of days specified in this parameter. Any number greater than or equal to zero. Default value is zero. scale_dividend: type: number format: number default: 1 example: 1 description: Allows all of the dividends in the implied dividend schedule to be scaled by this input parameter. Any number greater than zero and less than 5. Default value is one. volatility_shift: type: number format: number default: 0 example: 0 description: Allows the user to change the implied volatility that is used to compute the price of the option (calculated from the volatility surface) by adding the input value to the one computed. For example, if the parameter provided is 0.1, the implied volatility used to calculate the option price would add 10% to the implied volatility calculated internally from the volatility surface. Number between -0.25 and 0.25, default value of zero. request_id: type: string description: This request id is returned back to the sender in the response description: Parameters for the option to price required: true /target_portfolio_handler: get: description: Get all MerQube portfolio_handler. summary: Get all MerQube portfolio_handler. tags: - portfolio_handler parameters: - $ref: '#/components/parameters/filterParam' - $ref: '#/components/parameters/idsParam' - $ref: '#/components/parameters/nameParam' - $ref: '#/components/parameters/namesParam' - $ref: '#/components/parameters/namespaceParam' - $ref: '#/components/parameters/fieldsParam' - $ref: '#/components/parameters/debugParam' - $ref: '#/components/parameters/formatParam' responses: '200': description: 200 response content: application/json: schema: type: object properties: results: type: array items: $ref: '#/components/schemas/TargetPortfolioHandlerPatchPutGet' error_codes: $ref: '#/components/schemas/ErrorCodes' post: description: Create a new MerQube portfolio_handler summary: Create a new MerQube portfolio_handler tags: - portfolio_handler requestBody: content: application/json: schema: $ref: '#/components/schemas/TargetPortfolioHandlerPost' responses: '200': description: OK content: application/json: schema: type: object properties: id: type: string description: the uuid of this portfolio_handler status: type: string '400': description: illegal request body '403': description: not authorized to perform this operation /target_portfolio_handler/{uuid}: parameters: - $ref: '#/components/parameters/uuidParam' get: description: Returns the MerQube portfolio_handler with this uuid summary: Returns the MerQube portfolio_handler with this uuid tags: - portfolio_handler responses: '200': description: 200 response content: application/json: schema: $ref: '#/components/schemas/TargetPortfolioHandlerPatchPutGet' '403': description: not authorized to perform this operation '404': description: portfolio_handler does not exist put: description: Replace a MerQube portfolio_handler. summary: Replace a MerQube portfolio_handler tags: - portfolio_handler requestBody: content: application/json: schema: $ref: '#/components/schemas/TargetPortfolioHandlerPatchPutGet' responses: '200': description: OK '400': description: illegal request body '403': description: not authorized '404': description: portfolio_handler does not exist patch: description: Partialy update a MerQube portfolio_handler. summary: Partially update a MerQube portfolio_handler tags: - portfolio_handler requestBody: content: application/json: schema: type: object # TODO; problem here is, this would accept any fields from portfolio_handler def but none are required description: any fields from an portfolio_handler Manifest responses: '200': description: OK '400': description: illegal request body '403': description: not authorized '404': description: portfolio_handler does not exist delete: description: Delete a MerQube portfolio_handler. summary: Delete a MerQube portfolio_handler. tags: - portfolio_handler responses: '200': description: OK '403': description: not authorized '404': description: portfolio_handler does not exist /options/availability_dates/{fysm_id}/{country_code}: parameters: - $ref: '#/components/parameters/fsymIdParam' - $ref: '#/components/schemas/CountryCode' get: description: Returns a collection of availablity dates for the provided underlier summary: Returns a collection of availablity dates for the provided underlier tags: - options responses: '200': description: 200 response content: application/json: schema: type: object '403': description: not authorized to perform this operation '404': description: No data available for provided fysm/country code tags: - name: identifier description: tickers for various providers - name: index description: APIs for MerQube Indices - name: legacy_equity_security description: Equity securities (legacy non secapi) - name: options externalDocs: description: More details at url: https://merqube.com/api description: Option Pricing APIs - name: security description: securities - name: security_list description: lists of securities - name: portfolio_handler description: list of portfolio handlers components: schemas: MetricResult: type: object properties: value: type: number nullable: true description: The computed value of the metric, or null if it failed. error: type: string nullable: true description: Error message if the metric could not be computed. StatsResponse: type: object properties: metrics: type: object additionalProperties: $ref: '#/components/schemas/MetricResult' description: A dictionary of computed metrics and their results or errors. StatsRequest: type: object required: - return_period properties: start_date: type: string format: date example: '2006-12-29' end_date: type: string format: date example: '2006-12-29' index_metric: type: string example: price_return default: price_return target_return: type: number format: float minimum: 0 example: 0 return_period: type: string enum: - D - W - M - Y example: D benchmark: type: object required: - identifier - identifier_type - type properties: benchmark_type: type: string enum: - MERQUBE_INDEX - EQUITY example: MERQUBE_INDEX identifier_type: type: string enum: - TICKER - FSYM_ID example: TICKER identifier: type: string example: MY_INDEX_NAME metric: type: string example: index_level IntradayPublishConfigWrapper: description: oneOfs at the top level of an object lead to hard to work with RootModels in pydantic. Forming this one property object makes importing and passing around this object less painful; there is a lot of code that passes this around. type: object properties: publish_config: $ref: '#/components/schemas/IntradayPublishConfig' AlertHours: type: object properties: start: description: Start of the silent hours in HH:MM 24h format. The timezone is based on the intraday.tzinfo type: string pattern: ^[0-2]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$ end: description: Start of the silent hours in HH:MM 24h format. The timezone is based on the intraday.tzinfo type: string pattern: ^[0-2]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$ IntradayAlertType: type: string enum: - opsgenie - slack IntradayFlatlineAlerts: type: object properties: enabled: description: If the flatline alert should be enabled type: boolean default: true window_length: description: window_length in minutes for flatline alert default: 5 type: integer minimum: 1 min_ticks: description: Minimum number of ticks in the window to be the same to considered a flatline type: integer minimum: 2 alert_hours: $ref: '#/components/schemas/AlertHours' alert_type: $ref: '#/components/schemas/IntradayAlertType' default: opsgenie description: Type of alert to send when flatline is detected. Default is opsgenie. IntradayAlerting: description: Alerting configuration for intraday ticks type: object additionalProperties: false properties: flatline_alerts: $ref: '#/components/schemas/IntradayFlatlineAlerts' Intraday: allOf: - $ref: '#/components/schemas/IntradayPublishConfigWrapper' - type: object description: Only available for indexes with intraday tick computation additionalProperties: false required: - enabled - tzinfo properties: enabled: description: If the intraday process should be run or not type: boolean security_id: description: Security ID of the intraday_index security where ticker data is served type: string ticker_period: description: Duration between ticker datapoints. In seconds type: number minimum: 1 tzinfo: description: Timezone of intraday tick timestamp comparisons type: string active_time_ranges: type: array items: $ref: '#/components/schemas/IntradayTickFilter' infra_timed_scaling: $ref: '#/components/schemas/IntradayInfraTimedScaling' calculation_max_retry_delay: description: How many seconds to keep retrying the real time calculation before setting the force flag. Defalts to 0 which means retry forever. type: integer minimum: 0 resource_cpu_request: description: Minimum cpu resources requested in milliCPU type: integer minimum: 1 resource_memory_request: description: Minimum memory resources requested in mebibytes. type: integer minimum: 0 heartbeat_timeout: description: Max number of seconds between heartbeats before the rtindex pod is considered unhealthy type: integer minimum: 1 startup_failure_timeout: description: Max number of seconds to wait for the first heartbeat from the rtindex pod before considering it a failed startup. By default it will wait 40sec type: integer minimum: 1 data_refresh_period: description: After the rtindex refreshes its data this is the number of seconds to wait before refreshing again. 0 means do not refresh. Defaults to 3600 seconds (60min) type: integer minimum: 0 tick_delay: description: Number of seconds to delay intraday calculation type: integer minimum: 0 alerting: $ref: '#/components/schemas/IntradayAlerting' ohl_enabled: description: Should send Open High Low data to providers type: boolean default: false opening_tick_time: description: The time of opening tick in index's timezone. The index will send data against this type: string pattern: ^(?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)$ # need to use single quote her else things break # Index definitions Administrative: type: object additionalProperties: false required: - role properties: role: type: string enum: - data point - verification - calculation - development - administration deadlines: type: array items: $ref: '#/components/schemas/Deadline' client: type: object properties: requested_by: description: this is the actual OAuth token email that originated the POST on index-template (similar to created_by and last_modified_by). Except, this is the user on the templating POST not the actual POST to index because the post to index is going to be a MerQube employee, but we need to capture who originated the templating request aka who called the meta-api. This field is used to put this index on that user's Manage My Indices page. type: string approved_by: description: if a client requests an index to a finanancial institution, and that instituion approves the index parameters for launch, this holds the oauth email of that approver type: string owner: description: the idea here is to capture the client at a higher level than the above, e.g., this index is owned by Bank of Greatness. # should probably be made into a real CRUD type: string IndexDefinitionPost: type: object title: Index Manifest required: - description - administrative - launch_date - name - stage - title additionalProperties: false properties: administrative: $ref: '#/components/schemas/Administrative' base_date: $ref: '#/components/schemas/BaseDate' base_year: type: integer benchmark: oneOf: - $ref: '#/components/schemas/IndexBenchmark' - type: array items: $ref: '#/components/schemas/IndexBenchmark' calc_freq: type: string enum: - Daily - Daily, EOD - Intraday currency: type: string custom_metrics: type: array items: $ref: '#/components/schemas/MetricsSchema' description: type: string display_month: type: string enum: - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec documents: type: object excess_strategy: type: string enum: - keep_in_cash family: type: string family_description: type: string family_codes: type: array minItems: 1 maxItems: 1 items: type: string first_value_date: description: the first date that the index has a value; if set, will be < base_date $ref: '#/components/schemas/IsoDate' identifiers: type: array minItems: 0 items: $ref: '#/components/schemas/IdentifierUUIDRef' intraday: $ref: '#/components/schemas/Intraday' launch_date: type: string methodology: type: string month: type: integer name: type: string pattern: ^[a-zA-Z][a-zA-Z0-9-_]{0,99}$ namespace: type: string plot_metric: type: string portfolio_allocation_display: type: boolean description: whether or not portfolio_allocations are shown on the website. false by default portfolio_display: type: object properties: fields: type: array items: type: object properties: display_name: type: string field_name: type: string portfolio_handler_id: type: string rebal_freq: $ref: '#/components/schemas/RebalFrequency' related: type: array items: $ref: '#/components/schemas/Related' run_configuration: $ref: '#/components/schemas/RunConfig' run_configurations: type: array items: $ref: '#/components/schemas/RunConfigLabel' sales_force_deal_id: type: string description: SalesForce Deal ID spec: $ref: '#/components/schemas/IndexSpec' freezer_config: $ref: '#/components/schemas/FreezerConfig' calculation_check: $ref: '#/components/schemas/CalculationCheck' stage: type: string enum: - prod - test - development - backtest - inqubator tags: type: string title: type: string webpage: $ref: '#/components/schemas/Webpage' weighting_method: type: string enum: - Other - Equal eod_rt_price_check: type: boolean notify_configuration: $ref: '#/components/schemas/NotificationConfig' fill_missing_data: type: boolean description: Controls missing equity price recovery. The API derives this flag from stage and stores true only for backtest; all other stages store false. # see https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/ # On POST, status is illegal. Subsequently, its always there and required on patch/put. Same with ID. IndexDefinitionPatchPutGet: type: object additionalProperties: false allOf: - $ref: '#/components/schemas/IndexDefinitionPost' - $ref: '#/components/schemas/CrudExtra' RebalFrequency: type: string enum: - Annual - Daily - Monthly - Quarterly - Semi-Annual - Weekly - Bi-Monthly - Intraday - None IndexSpec: type: object required: - index_class_code properties: index_class_code: type: string index_class_args: type: object index_variables: type: object description: TODO version: type: integer CalculationCheck: type: array items: type: object oneOf: - $ref: '#/components/schemas/LevelCheck' - $ref: '#/components/schemas/PercentChangeCheck' - $ref: '#/components/schemas/HistoryCheck' BaseCheck: type: object required: - metric - enabled properties: metric: type: string enabled: type: boolean alert_type: type: string default: fail_computation enum: - email - slack - opsgenie - fail_computation LevelCheckParams: type: object required: - min - max properties: min: type: number nullable: true max: type: number nullable: true LevelCheck: type: object required: - check_type - params allOf: - type: object properties: check_type: type: string enum: - LEVEL_CHECK - $ref: '#/components/schemas/BaseCheck' - type: object properties: params: $ref: '#/components/schemas/LevelCheckParams' PercentChangeCheckParams: type: object required: - min - max properties: min: type: number nullable: true max: type: number nullable: true PercentChangeCheck: type: object required: - check_type - params allOf: - type: object properties: check_type: type: string enum: - PERCENT_CHANGE_CHECK - $ref: '#/components/schemas/BaseCheck' - type: object properties: params: $ref: '#/components/schemas/PercentChangeCheckParams' HistoryCheckParams: type: object required: - days properties: days: type: integer minimum: 0 maximum: 365 nullable: true HistoryCheck: type: object required: - check_type - params allOf: - type: object properties: check_type: type: string enum: - HISTORY_CHECK - $ref: '#/components/schemas/BaseCheck' - type: object properties: params: $ref: '#/components/schemas/HistoryCheckParams' Related: type: object required: - id - name - type properties: default_display: type: boolean default: false id: type: string metric: type: string name: type: string type: type: string enum: - security - index Webpage: type: object properties: custom_charts: type: array items: $ref: '#/components/schemas/CustomCharts' visible: type: boolean default: true CustomCharts: type: object additionalProperties: false required: - name - xlabel - ylabel properties: name: type: string xlabel: type: string ylabel: type: string chart_type: type: string enum: - line - spline - area - bar - column default: line compare_mode: type: string enum: - absolute - percent default: percent constructor_type: type: string enum: - chart - stockChart default: stockChart size: type: number default: 12 data: type: array items: type: object additionalProperties: false required: - url - array_field - values - key_field properties: url: type: string array_field: type: string values: type: array items: type: object additionalProperties: false required: - display_name - path properties: display_name: type: string path: type: string key_field: type: string IndexBenchmark: type: object additionalProperties: false required: - ticker - threshold properties: ticker: type: string description: accepts either FSYM_ID, or MQI:XXX to benchmark against another index. example: MQI:XXX threshold: description: the deviation that triggers an outlier event, IE, the daily difference of the index vs the daily difference of the underlying should not be more than this percent type: number example: 0.05 index_metric: description: the metric of this index to compare against the ticker/threshold, eg can compare some other metric of this index than price_return type: string default: price_return example: total_return benchmark_metric: type: string description: only accepted if the ticker is an MQI. The metric of the benchmark index to compare against; eg can compare to some other metric than price_return of the benchmark default: price_return example: total_return # Idenfitiers/providers IdentifierUUIDPost: description: Identifier for a given provider. Will be referenced via the name field of the Identifier section type: object required: - name - ticker - index_name # provider is not required here because its in the URL additionalProperties: false properties: display_name: type: string # needed to make sure tickers arent reused across indices; so we cant point multiple indices at this ticker # note however that an index can point to multiple tickers. index_name: type: string metric: type: string name: description: unique name among all other Identifiers of the provider resource type. type: string # reserved URL chars: https://developers.google.com/maps/url-encoding pattern: ^[^!*'() ;:@&=+$,/?%#\[\]] namespace: type: string rounding_decimals: type: integer description: If rounding_type=standard, corresponds to number of decimal places to round to. If rounding_type=sigfig, corresponds to number of significant figures to round to. rounding_type: type: string enum: [standard, sigfig] default: standard description: Type of rounding to apply to the disseminated data. standard = normal python round(), sigfig = significant figures rounding. provider_kwargs: anyOf: - $ref: '#/components/schemas/BloombergProviderKwargs' - $ref: '#/components/schemas/ReutersProviderKwargs' - $ref: '#/components/schemas/SecapiProviderKwargs' - $ref: '#/components/schemas/NasdaqProviderKwargs' start_date: type: string format: date ticker: type: string num_days: type: integer description: Number of days to disseminate data for minimum: 0 IdentifierUUIDPatchPutGet: type: object additionalProperties: false allOf: - $ref: '#/components/schemas/IdentifierUUIDPost' - $ref: '#/components/schemas/CrudExtra' IndexIdentifierUUIDPost: type: object additionalProperties: false allOf: - $ref: '#/components/schemas/IdentifierUUIDPost' - type: object properties: enabled: type: boolean default: true description: Determines if the index will disseminate data based to this provider, default is true IdentifierUUIDRef: description: maps to an identifier resource type: object additionalProperties: false required: - name - provider properties: name: type: string provider: $ref: '#/components/schemas/Provider' enabled: default: true description: Determines if the index will disseminate data based on this Identifier type: boolean Provider: description: currently supported providers type: string enum: - bloomberg - reuters - morningstar - factset - nasdaq - wind - secapi example: bloomberg BloombergProviderKwargsPostType: type: string description: How to post the data to Bloomberg, either the end of day method (EOD), real time method (RT) or both (EOD_AND_RT) enum: - EOD - RT - EOD_AND_RT BloombergProviderKwargs: type: object description: Bloomberg provider custom arguments additionalProperties: false properties: post_type: $ref: '#/components/schemas/BloombergProviderKwargsPostType' required: - post_type ReutersProviderKwargsPostType: type: string description: How to post the data to Reuters, either the end of day method (EOD), real time method (RT) or both (EOD_AND_RT) enum: - EOD - RT - EOD_AND_RT - EOD_AND_RT_COMBINED ReutersProviderKwargs: type: object description: Reuters provider custom arguments additionalProperties: false properties: post_type: $ref: '#/components/schemas/ReutersProviderKwargsPostType' SecapiProviderKwargs: type: object description: Secapi provider custom arguments additionalProperties: false properties: security_type: type: string security_name: type: string metric: type: string required: - security_type - security_name - metric NasdaqProviderKwargs: type: object description: Nasdaq provider custom arguments additionalProperties: false properties: nasdaq_env: type: string description: Which Nasdaq environment to send data to enum: - testing - production eod_date_delta: type: integer description: How many days to offset the Nasdaq date (T if before 6:30pm EST otherwise T + 1) when getting EOD data from the Index required: - nasdaq_env ListDataCollections: type: object additionalProperties: true properties: data_collection: type: array items: $ref: '#/components/schemas/DataCollectionsSpec' default_factory: list DataCollectionsSpec: type: object description: schema for data collections additionalProperties: true required: - name - location - index_dc_subtype properties: index_dc_subtype: description: Index Data Collection Subtype object key moves to array after transformation type: string auto_persist: default: false description: Boolean to indicate whether to automatically persist the data. Default is false. type: boolean compression: default: GZIP enum: - NONE - GZIP type: string date_col: default: date type: string format: default: csv enum: - csv type: string layout_type: default: SINGLE_FILE description: 'SINGLE_FILE: one file. YEARLY_DIR_DAILY_FILE: one directory per year, each day, a file with YYYYMMDD format.' enum: - SINGLE_FILE - YEARLY_DIR_DAILY_FILE type: string location: type: string name: maxLength: 128 minLength: 3 pattern: ^[A-Za-z0-9_]*$ type: string seed_file_path: description: Seed file for the data collection. type: string start_time: type: string BasketPortfolioPutIn: type: object description: > Input data for creating/replacing target portfolios. This object captures all information needed to execute externally defined rebalances. additionalProperties: false required: - timestamp - positions - unit_of_measure properties: positions: title: Positions type: array items: $ref: '#/components/schemas/ValidEquityBasketPosition' timestamp: description: the time at which the portfolio should take effect $ref: '#/components/schemas/IsoTS' unit_of_measure: $ref: '#/components/schemas/PortfolioUom' target_portfolio_type: type: string enum: - EOD - INTRADAY default: EOD description: Whether its an end of day portfolio or an intraday portfolio. share_selection_date: description: Share selection date, if specified, should be before the effective date (parameter 'timestamp') for this Target Portfolio. In case when the unit_of_measure is set to WEIGHT, we first determine the shares using the prices on the share selection date. If any constituent is de-listed by the share selection date, then that constituent's weight is distributed to other constituents before selecting the shares. We then apply the corporate actions from the share selection date to the day before the portfolio effective date. In case when the unit_of_measure is set to SHARES, we follow the similar steps as above, except the step of determining shares, as it is not needed. $ref: '#/components/schemas/IsoTS' divisor: type: number description: A scaling factor to apply for the SHARES of the portfolio constituents external_id: type: string description: An external ID to reference this portfolio with. Must be unique per index. BasketPortfolioPatchIn: type: object description: > Input data for updating an existing target portfolio additionalProperties: false properties: status: $ref: '#/components/schemas/PortfolioStatus' status_change_reason: type: string BasketPortfolioRaw: type: object description: > Target Portfolio. Supports equities, futures, and options. This object captures all information needed to execute externally defined rebalances. This is the raw data from the data store layer. additionalProperties: false allOf: - $ref: '#/components/schemas/BasketPortfolioPutIn' - type: object required: - id - status properties: id: type: string example: 0000699a-fcd7-45d4-8ce4-064a4ffeced0 status: $ref: '#/components/schemas/PortfolioStatus' default: FINAL status_change_reason: type: string created_ts: $ref: '#/components/schemas/IsoTS' BasketPortfolio: type: object description: > Target Portfolio. Supports equities, futures, and options. This object captures all information needed to execute externally defined rebalances. additionalProperties: false allOf: - $ref: '#/components/schemas/BasketPortfolioRaw' - type: object required: - created_ts properties: created_ts: $ref: '#/components/schemas/IsoTS' TimestampWindow: type: object additionalProperties: false required: - end_ts properties: start_ts: type: string description: the time of day of the deadline pattern: ^(?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)$ end_ts: type: string description: the time of day of the deadline pattern: ^(?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)$ tzinfo: type: string description: Timezone of the window TargetPortfolioHandlerPatchPutGet: type: object additionalProperties: false allOf: - $ref: '#/components/schemas/TargetPortfolioHandlerPost' - $ref: '#/components/schemas/CrudExtra' TargetPortfolioHandlerPost: type: object description: Describes how to handle the validation and selection of Target Portfolios additionalProperties: false required: - name - namespace properties: name: type: string namespace: type: string description: the calling user must have permission to this namespace to create the handler in this namespace validation_window: $ref: '#/components/schemas/TimestampWindow' selection_window: $ref: '#/components/schemas/TimestampWindow' auto_select: type: boolean description: If true, the handler will automatically select the last valid portfolio for an effective timestamp validator_fn: type: string intraday_validation_window: $ref: '#/components/schemas/TimestampWindow' description: Window to submit intraday portfolios for validation. intraday_selection_window: $ref: '#/components/schemas/TimestampWindow' description: Window to select intraday portfolios for an effective timestamp. intraday_auto_select: type: boolean description: If true, the handler will automatically select the last valid intraday portfolio for an effective timestamp intraday_validator_fn: type: string event_notification_config: type: object additionalProperties: false properties: PENDING_VALIDATION: $ref: '#/components/schemas/TargetPortfolioHandlerNotificationConfig' FAILED_VALIDATION: $ref: '#/components/schemas/TargetPortfolioHandlerNotificationConfig' PASSED_VALIDATION: $ref: '#/components/schemas/TargetPortfolioHandlerNotificationConfig' SELECTED: $ref: '#/components/schemas/TargetPortfolioHandlerNotificationConfig' UNSELECTED: $ref: '#/components/schemas/TargetPortfolioHandlerNotificationConfig' FINAL: $ref: '#/components/schemas/TargetPortfolioHandlerNotificationConfig' PAST_DEADLINE: $ref: '#/components/schemas/TargetPortfolioHandlerNotificationConfig' TargetPortfolioHandlerNotificationConfig: type: object additionalProperties: false properties: diss_destinations: $ref: '#/components/schemas/DisseminationDestinations' file_name_format: type: string RealTimeTradeType: title: RealTimeTradeType description: Trade types that can be used for real time quotes. Examples of ineligible trade types are dark pool and odd lot trades. enum: - ELIGIBLE - INELIGIBLE PortfolioUom: type: string title: PortfolioUom description: Used to indicate if portfolio amounts are absolute or relative. weight indicates portfolio amounts are relative weights units indicates portfolio amounts are absolute values, e.g. shares or number of contracts enum: - SHARES - WEIGHT PortfolioStatus: type: string title: PortfolioStatus description: > Indicates the status of a target portfolio. A portfolio can only be used in an index if status is `FINAL` * `PENDING_VALIDATION` - Custom validation is necessary, and is queued up * `FAILED_VALIDATION` - Custom validation has failed. * `PASSED_VALIDATION` - Custom validation has succeeded. The portfolio must now be selected * `SELECTED` - Selected for usage on a date, but has not yet been locked in / finalized * `UNSELECTED` - Was previously selected, but a newer portfolio has replaced it for that date * `FINAL` - This portfolio can now be used for the given date. * `DELETED` - This portfolio has been deleted or rejected for usage. enum: - PENDING_VALIDATION - FAILED_VALIDATION - PASSED_VALIDATION - SELECTED - UNSELECTED - FINAL - DELETED BasketPosition: type: object description: A general basket portfolio position additionalProperties: false required: - asset_type - identifier - identifier_type - amount properties: amount: title: Amount type: number asset_type: $ref: '#/components/schemas/AssetType' identifier: title: Identifier type: string identifier_type: $ref: '#/components/schemas/PositionIdentifierType' position_id: title: Position Id type: string example: '1' DatedBasketPosition: allOf: - $ref: '#/components/schemas/BasketPosition' - type: object required: - date properties: date: $ref: '#/components/schemas/IsoDate' selection_date: $ref: '#/components/schemas/IsoDate' RicSpecific: type: object additionalProperties: false properties: identifier_type: $ref: '#/components/schemas/PositionIdentifierType' real_time_trade_types: items: $ref: '#/components/schemas/RealTimeTradeType' type: array use_primary_listing: default: false description: use the security's primary listing rather than the one from the identifier title: Use Primary Listing type: boolean FsymSpecific: type: object additionalProperties: false required: - country_code properties: country_code: $ref: '#/components/schemas/CountryCode' OptionSpecific: type: object additionalProperties: false required: - expiration_date - type - strike - amount - underlying - currency properties: identifier: # Redeclaring here because this is NOT required for futures title: Identifier type: string identifier_type: # Redeclaring here because this is NOT required for futures $ref: '#/components/schemas/PositionIdentifierType' expiration_date: title: Expiration Date $ref: '#/components/schemas/IsoDate' type: title: Type $ref: '#/components/schemas/OptionType' style: title: Style $ref: '#/components/schemas/OptionStyle' strike: title: Strike Price type: number strike_type: title: Strike Type type: string enum: - PCT_SPOT - DELTA - SPCT_SPOT underlying: title: Underlying Symbol type: string expiration_type: title: Expiration Type $ref: '#/components/schemas/OptionExpirationType' mic: title: Mic Code type: string pattern: '[A-Z0-9]{4}' amount: # overriding from base BasketPosition, just to change the title title: Amount of Shares type: number currency: title: Currency type: string default: USD lag: title: Option Lag $ref: '#/components/schemas/IsoTS' delta_hedge_flag: type: boolean vol_multiplier: # Barclays specific field type: number structure_id: # Barclays specific field type: number minimum: 0 leg_multiple: # Barclays specific field type: number FuturesSpecific: type: object additionalProperties: false required: - expiration_date - amount - underlying - currency properties: identifier: # Redeclaring here because this is NOT required for futures title: Identifier type: string identifier_type: # Redeclaring here because this is NOT required for futures $ref: '#/components/schemas/PositionIdentifierType' expiration_date: title: Expiration Date $ref: '#/components/schemas/IsoDate' underlying: title: Underlying Symbol type: string amount: # overriding from base BasketPosition, just to change the title title: Amount of Shares type: number currency: title: Currency type: string default: USD lag: title: Futures Lag $ref: '#/components/schemas/IsoTS' RicEquityPosition: description: Equity position, identified by a RIC allOf: - $ref: '#/components/schemas/BasketPosition' - $ref: '#/components/schemas/RicSpecific' DatedRicEquityPosition: allOf: - $ref: '#/components/schemas/DatedBasketPosition' - $ref: '#/components/schemas/RicSpecific' FsymEquityPosition: description: Equity position, identified by a FSYM + country code allOf: - $ref: '#/components/schemas/BasketPosition' - $ref: '#/components/schemas/FsymSpecific' DatedFsymEquityPosition: allOf: - $ref: '#/components/schemas/DatedBasketPosition' - $ref: '#/components/schemas/FsymSpecific' OptionPosition: description: An Option position allOf: # The order of this is intentionally switched so that OptionSpecific # takes precedence for overriding required fields - $ref: '#/components/schemas/OptionSpecific' - $ref: '#/components/schemas/BasketPosition' FuturesPosition: description: A Futures position allOf: # The order of this is intentionally switched so that FuturesSpecific # takes precedence for overriding required fields - $ref: '#/components/schemas/FuturesSpecific' - $ref: '#/components/schemas/BasketPosition' SecapiSpecific: type: object additionalProperties: false properties: custom_metric: type: string SecapiBasketPosition: description: A basket position that uses custom metrics from merqube data source allOf: - $ref: '#/components/schemas/BasketPosition' - $ref: '#/components/schemas/SecapiSpecific' MerqubeIndexSpecific: type: object additionalProperties: false properties: metric_name: type: string MerqubeIndexPosition: description: A basket position that uses custom metrics from merqube data source allOf: - $ref: '#/components/schemas/BasketPosition' - $ref: '#/components/schemas/MerqubeIndexSpecific' ValidEquityBasketPosition: oneOf: - $ref: '#/components/schemas/BasketPosition' - $ref: '#/components/schemas/RicEquityPosition' - $ref: '#/components/schemas/FsymEquityPosition' - $ref: '#/components/schemas/OptionPosition' - $ref: '#/components/schemas/FuturesPosition' - $ref: '#/components/schemas/SecapiBasketPosition' - $ref: '#/components/schemas/MerqubeIndexPosition' DatedValidEquityBasketPosition: oneOf: - $ref: '#/components/schemas/DatedBasketPosition' - $ref: '#/components/schemas/DatedRicEquityPosition' - $ref: '#/components/schemas/DatedFsymEquityPosition' FreezerConfig: type: object additionalProperties: false properties: primary_index_name: type: string description: the primary index to use underlying data from prices: type: boolean default: false rebalances: type: boolean default: false corax: type: boolean default: false fx_rates: type: boolean default: false PositionIdentifierType: title: PositionIdentifierType type: string enum: - RIC - CURRENCY_CODE - FSYM_ID - TICKER - BBG_TICKER - CUSIP example: FSYM_ID DayOfWeek: enum: - MON - TUE - WED - THU - FRI title: Day of Week type: string example: MON AssetType: enum: - CASH - THIRD_PARTY_INDEX - EQUITY - OPTION - FUTURES - MUTUAL_FUND - MERQUBE_INDEX - CUSTOM_SECAPI_INDEX - OTHER title: Asset Type type: string example: EQUITY OptionStyle: enum: - AMERICAN - EUROPEAN title: Option Style type: string example: AMERICAN OptionType: enum: - PUT - CALL title: Option Type type: string example: PUT OptionExpirationType: enum: - AM - PM title: Option Expiration Type type: string example: AM TradeType: enum: - BUY - SELL title: Trade Type type: string example: BUY StrategyOptionStrikeType: enum: - PCT_SPOT - DELTA - INCOME - COSTLESS title: Option Strike Type type: string example: PCT_SPOT StrategyOptionExpiryPeriodType: enum: - ANNUALLY - QUARTERLY - MONTHLY_3RD_FRIDAY - WEEKLY title: Expiry Period Type type: string example: MONTHLY_3RD_FRIDAY OptionStrategyType: title: Option Strategy Type type: string enum: - COVERED_CALL - PUT_WRITE - PROTECTIVE_PUT - COLLAR - CUSTOM example: COLLAR # Secapi types SecurityCreationResponse: type: object properties: id: type: string inserts: type: integer NewSecurity: type: object required: - name - namespace - prov_ts additionalProperties: false properties: name: type: string # reserved URL chars: https://developers.google.com/maps/url-encoding pattern: ^[^!*'() ;:@&=+$,/?%#\[\]] namespace: type: string description: the calling user must have permission to this namespace to create the security in this namespace eff_ts: $ref: '#/components/schemas/MerqTimestamp' description: 'DEPRECATED: this is no longer used for security creates, but allowed for backwards compatibility' prov_ts: $ref: '#/components/schemas/MerqTimestamp' source: type: string SecurityMetrics: type: object required: - eff_ts - id - metric - value - prov_ts properties: eff_ts: $ref: '#/components/schemas/MerqTimestamp' id: type: string example: 0000699a-fcd7-45d4-8ce4-064a4ffeced0 metric: type: string example: Level source: type: string example: some_gcp_feed lineage: type: object description: data lineage information, for MerQube use only. prov_ts: $ref: '#/components/schemas/MerqTimestamp' value: anyOf: # allow any type: - type: string - type: number - type: integer - type: boolean - type: array items: {} - type: object SecurityMetricsDeletion: description: like a SecurityMetric, but no value and an optional prov_ts; marks the deletion of an id/eff_ts/metric tuple. type: object required: - id - eff_ts - metric properties: eff_ts: $ref: '#/components/schemas/MerqTimestamp' id: type: string example: 0000699a-fcd7-45d4-8ce4-064a4ffeced0 metric: type: string example: Level prov_ts: $ref: '#/components/schemas/MerqTimestamp' source: type: string example: some_gcp_feed MetricsSchema: type: object required: - data_type - description - name properties: data_type: enum: - string - number64 - datetime64 - int64 - bool - object type: string description: description: a description of what this metric represents type: string name: description: metric name type: string object_schema: description: optional - this supports complex objects, ie you can specify the metric is of this schema. THis allows you to upload a json schema itself of this metric. THis is for downstream users of this metric. #$ref: http://json-schema.org/draft-07/schema# type: object SecurityListPost: description: represents a list of securities type: object additionalProperties: false required: - name - securities properties: name: description: unique name among all other security lists type: string # reserved URL chars: https://developers.google.com/maps/url-encoding pattern: ^[^!*'() ;:@&=+$,/?%#\[\]] namespace: type: string realtime: type: boolean securities: type: array items: type: object additionalProperties: false required: - security_type - identifier_type - identifier_value properties: identifier_type: type: string enum: - RIC - secapi_name identifier_value: type: string example: AAPL.QQ security_type: type: string example: equity SecurityListPatchPutGet: type: object additionalProperties: false allOf: - $ref: '#/components/schemas/SecurityListPost' - $ref: '#/components/schemas/CrudExtra' # very old - from 2020, not sure if even accurate # TODO this doesnt seem like its used anymore? OptionResponse: type: object title: Option Response Schema properties: price: type: number format: number description: Option Price vol: type: number format: number description: Implied Volatility interest_rate: type: number format: number description: Implied Interest Rate dividend_yield: type: number format: number description: Implied Dividend Yield for the underlying spot: type: number format: number description: Underlying spot price delta: type: number format: number description: Delta of this option theta: type: number format: number description: Theta of the option being priced gamma: type: number format: number description: Gamma of the option being priced vega: type: number format: number description: Vega of the option being priced bid_ask_spread: type: number format: number description: Spread between Bid and Ask prices of the option being priced request_id: type: string description: Request ID sent in the request x-examples: {} DefinedOutcomeSolverRequest: type: object title: Client Defined Outcome Option Price Solver Response Schema additionalProperties: false required: - expiry - options - root properties: expiry: type: object $ref: '#/components/schemas/ClientDefinedOutcomeExpiry' root: type: string $ref: '#/components/schemas/ClientDefinedOutcomeRoots' options: type: array items: $ref: '#/components/schemas/ClientDefinedOutcomeOption' variable_leg_strategy: type: object nullable: true oneOf: - $ref: '#/components/schemas/ClientDefinedOutcomeParticipationRateStrategy' - $ref: '#/components/schemas/ClientDefinedOutcomeNoEtfStrategy' - $ref: '#/components/schemas/ClientDefinedOutcomeCashStrategy' discriminator: propertyName: strategy mapping: PARTICIPATION_RATE: '#/components/schemas/ClientDefinedOutcomeParticipationRateStrategy' NO_ETF: '#/components/schemas/ClientDefinedOutcomeNoEtfStrategy' CASH: '#/components/schemas/ClientDefinedOutcomeCashStrategy' description: The variable leg strategy to use. If not specified, defaults to Cap strategy. variable_leg_params: nullable: true $ref: '#/components/schemas/ClientDefinedOutcomeOption' description: User-defined option parameters for Participation Rate strategy DefinedOutcomeSolverResponse: type: object title: Client Defined Outcome Option Price Solver Response Schema additionalProperties: false properties: option_solutions: type: array items: oneOf: - $ref: '#/components/schemas/OptionPriceMetrics' - type: description: Option Price Metrics variable_leg_solution: type: object allOf: - oneOf: - $ref: '#/components/schemas/ClientDefinedOutcomeOption' - type: - properties: price: type: number format: number description: Option Price required: - price description: Variable Leg Metrics variable_leg_cash_solution: type: number format: float nullable: true description: Cash solution when Cash strategy is selected OptionPriceMetrics: type: object title: Option Price Metrics Schema required: - price - vol - interest_rate - dividend_yield - spot - delta - theta - gamma - vega - bid_ask_spread additionalProperties: false description: Option Price Metrics example: price: 0.01 vol: 0.2 interest_rate: 0.01 dividend_yield: 0.02 spot: 100.0 delta: 0.5 theta: -0.01 gamma: 0.1 vega: 0.2 bid_ask_spread: 0.01 properties: price: type: number format: number description: Option Price vol: type: number format: number description: Implied Volatility interest_rate: type: number format: number description: Implied Interest Rate dividend_yield: type: number format: number description: Implied Dividend Yield for the underlying spot: type: number format: number description: Underlying spot price delta: type: number format: number description: Delta of this option theta: type: number format: number description: Theta of the option being priced gamma: type: number format: number description: Gamma of the option being priced vega: type: number format: number description: Vega of the option being priced bid_ask_spread: type: number format: number description: Spread between Bid and Ask prices of the option being priced FindStrikeResponse: type: object title: Find Strike Response Schema properties: strike: type: number format: number description: Strike that prices to the given budget. spot: type: number format: number description: Underlying spot price. strike_percentage: type: number format: number description: Strike as a percentage of the underlying spot price that prices to the given budget. request_id: type: string description: Request ID sent in the request Deadline: type: object additionalProperties: false required: - time_of_day # required here means they will always be populated in the pydantic model (they have defaults), not that they are required by the user # if you dont put these as required, pydantic thinks these can be "None" - deadline_type - next_day - og_priority - business_days_prior properties: time_of_day: type: string description: the time of day of the deadline pattern: ^(?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)$ deadline_type: type: string enum: # TODO: can add more - calculation - restatement default: calculation next_day: description: set this to true if the index starts running on day T but the deadline does not pass until T+1 in that index timezone type: boolean default: false og_priority: type: string default: P1 enum: - P1 - P2 - P3 business_days_prior: type: integer description: the amount of days before T to check for data existence default: 0 metrics: type: array items: type: string description: the list of metrics to check in the deadline checker script Metrics: type: object properties: ts: type: string format: date-time description: iso8601 format metrics: $ref: '#/components/schemas/MetricsArr' MetricsArr: type: array items: type: object properties: id: type: string example: price_return value: type: number example: 1000.0000000000002 Stats: properties: annual_volatility: type: number example: 3.717606464173326 annualized_return: type: number example: 6.665050717276233 cumulative_return: type: number example: 2.7597506251556547 id: type: string example: YTD max_drawdown: type: number example: -1.3877029296510448 sharpe_ratio: type: number example: 1.759543308780235 start_date: $ref: '#/components/schemas/MerqTimestamp' end_date: $ref: '#/components/schemas/MerqTimestamp' MetricsDef: type: object properties: name: type: string example: daily_return type: type: string example: double ErrorCodes: type: object properties: code: type: string message: type: string IsoTS: type: string pattern: ^\d{4}-\d{2}-\d{2}(T|\s)\d{2}:\d{2}:\d{2}(\.\d{6})?$ example: 2022-01-02T01:02:03 IsoDate: type: string pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2} example: 2000-01-04 BaseDate: description: the date that the index has level 'base_value' type: string pattern: ^[0-9]{4}[-/][0-9]{2}[-/][0-9]{2} example: 2000-01-04 IntradayTickFilter: description: Filter for tick events, used to configure when an rtindex should process ticks or send ticks to targets type: object additionalProperties: false properties: start_date: $ref: '#/components/schemas/MerqTimestamp' end_date: $ref: '#/components/schemas/MerqTimestamp' start_time: description: Inclusive start time of the day to start running this intraday index. Format is %H:%M:%S.%f. This should be in the timezone of the index based on tzinfo. type: string example: 20:39:00.262345 end_time: description: Inclusive end time of the day to stop running this intraday index. Format is %H:%M:%S.%f. This should be in the timezone of the index based on tzinfo. type: string example: 20:39:00.262345 days_of_week: description: Which days of the week to run the index. Each day of the week is denoted by an integer with Monday = 0 and Sunday = 6 type: array items: type: integer exclude_holidays: description: If this is true use the index holiday calendar to decide which days to run the index. It will only run on non-holidays. type: boolean IntradayInfraTimedScaling: description: Describes how to scale up and down based on the active time range. type: object additionalProperties: false properties: enabled: description: Whether or not the deployment will be scaled up and down. type: boolean default: true start_time_buffer: description: The amount of minutes before the start time from which the deployment is scale up. type: integer default: 59 minimum: 10 maximum: 59 end_time_buffer: description: The amount of minutes past the end time after which the deployment is scaled down. type: integer default: 10 minimum: 5 maximum: 59 IntradayPublishConfigTargetBase: type: object properties: active_time_ranges: description: Time ranges during which values should be published to this target. Target level active_time_ranges override publish_config metric level active_time_ranges. type: array items: $ref: '#/components/schemas/IntradayTickFilter' IntradayPublishConfigDbTarget: allOf: - $ref: '#/components/schemas/IntradayPublishConfigTargetBase' - type: object properties: target: type: string enum: - db required: - target IntradayPublishConfigSecapiTarget: allOf: - $ref: '#/components/schemas/IntradayPublishConfigTargetBase' - type: object properties: target: type: string enum: - secapi required: - target IntradayPublishConfigBloombergTargetParams: type: object additionalProperties: false properties: rounding_decimals: type: integer ticker: type: string IntradayPublishConfigBloombergTarget: allOf: - $ref: '#/components/schemas/IntradayPublishConfigTargetBase' - type: object properties: target: type: string enum: - bloomberg params: $ref: '#/components/schemas/IntradayPublishConfigBloombergTargetParams' required: - target IntradayPublishConfigReutersTargetParams: type: object additionalProperties: false properties: rounding_decimals: type: integer ticker: type: string post_type: $ref: '#/components/schemas/ReutersProviderKwargsPostType' IntradayPublishConfigReutersTarget: allOf: - $ref: '#/components/schemas/IntradayPublishConfigTargetBase' - type: object properties: target: type: string enum: - reuters params: $ref: '#/components/schemas/IntradayPublishConfigReutersTargetParams' required: - target IntradayPublishConfig: description: Mapping of index metric to targets it should be sent to type: object additionalProperties: type: array items: oneOf: - $ref: '#/components/schemas/IntradayPublishConfigDbTarget' - $ref: '#/components/schemas/IntradayPublishConfigSecapiTarget' - $ref: '#/components/schemas/IntradayPublishConfigBloombergTarget' - $ref: '#/components/schemas/IntradayPublishConfigReutersTarget' RunState: type: object required: - status properties: status: # title gets used to generate the pydantic model class name $ref: '#/components/schemas/RunStateStatus' calculation_start_ts: description: set to the start of the last calculation, if the status is not PENDING_CREATION (has not ever started) $ref: '#/components/schemas/IsoTS' error: type: string description: An error message if status is FAILED RunStateStatus: description: the state of the last index run, if applicable type: string enum: - PENDING_CREATION - SUCCEEDED - FAILED - RUNNING FsymAndCountry: description: Represents the combination of a FSYM + Country Code type: object required: - fsym_id - country_code properties: fsym_id: type: string country_code: $ref: '#/components/schemas/CountryCode' IndexTicker: description: Represents a ticker of the index. Used in self service options to hold the Index as the underlier type: object required: - ticker properties: ticker: type: string enum: - NDX - SPX - RUT # Add more as needed - MQ5C - SXXP - SX5E # client indices ClientTemplateResponse: type: object properties: post_template: description: a full index manifest that can be posted $ref: '#/components/schemas/IndexDefinitionPost' bbg_ident_template: description: only returned if the client specified a bbg ticker $ref: '#/components/schemas/IdentifierUUIDPost' nullable: true target_ports: description: only returns for indices where the client should post the target portfolios type: array items: $ref: '#/components/schemas/BasketPortfolioPutIn' nullable: true ClientBaseVal: type: object additionalProperties: false required: - base_date - base_value properties: base_date: $ref: '#/components/schemas/BaseDate' base_value: type: number exclusiveMinimum: 0 description: set the index value on base_date to this base_value example: 1000.0 ClientOptionalBaseVal: type: object additionalProperties: false required: - base_value properties: base_date: $ref: '#/components/schemas/BaseDate' base_value: type: number exclusiveMinimum: 0 description: set the index value on base_date to this base_value example: 1000.0 ClientIndexBaseProperties: type: object additionalProperties: false required: - description - name - namespace - title properties: bbg_ticker: type: string description: due to the limitations of the Bloomberg ticker creation process (no API), this must be a pre-created ticker. You can email MerQube a list of tickers to create on your behalf at support@merqube.com. Then, you provide those as input to these indices example: MY_TICKER description: type: string description: set to the description of the index, which will show on merqube.com example: My Index Description email_list: type: array description: list of emails to send daily dissemination reports, and the initial backtest reports, to; if not specified, no emails will be sent items: type: string default_factory: list example: - bob@mycompany.com - alice@mycompany.com name: type: string description: 'set to the name of the index. Commonly people use the ticker as the name, but that is not necessary. Must be globally unique - you will get a 409 if this index name is taken ' example: My Index # reserved URL chars: https://developers.google.com/maps/url-encoding pattern: ^[^!*'() ;:@&=+$,/?%#\[\]] namespace: type: string description: set to the namespace of the index example: mycompany title: type: string description: set to the title of the index that shows up on merqube.com example: My Index Title ClientIndexConfigBase: allOf: - $ref: '#/components/schemas/ClientBaseVal' - $ref: '#/components/schemas/ClientIndexBaseProperties' ClientIndexConfigOptionalBaseDate: allOf: - $ref: '#/components/schemas/ClientOptionalBaseVal' - $ref: '#/components/schemas/ClientIndexBaseProperties' ClientEquityBasketConfigBase: allOf: - $ref: '#/components/schemas/ClientIndexConfigBase' - type: object additionalProperties: false description: class with shared properties among the equity basket group. properties: currency: type: string description: set to the currency of the index default: USD example: USD holiday_calendar: $ref: '#/components/schemas/HolidayCalendarSpec' is_intraday: type: boolean description: set to true if the index is to calculate multiple times during the day. This does not pertain to the frequency of rebalancing; see `rebal_freq`. Even though theoretically all index family types can calculate multiple times a day, not all types will support this initially. This parameter is a bit experimental in that sense. default: false example: false ClientEquityIndexConfigBase: allOf: - $ref: '#/components/schemas/ClientIndexConfigOptionalBaseDate' - type: object additionalProperties: false description: class with shared properties among the equity index group. properties: currency: type: string description: set to the currency of the index default: USD example: USD holiday_calendar: $ref: '#/components/schemas/HolidayCalendarSpec' is_intraday: type: boolean description: set to true if the index is to calculate multiple times during the day. This does not pertain to the frequency of rebalancing; see `rebal_freq`. Even though theoretically all index family types can calculate multiple times a day, not all types will support this initially. This parameter is a bit experimental in that sense. default: false example: false ReinvestmentTime: additionalProperties: false type: string description: set to the type of reinvestment to apply enum: - AT_OPEN - AT_CLOSE example: AT_OPEN default: AT_OPEN ReinvestmentType: additionalProperties: false type: string description: set to the type of reinvestment to apply enum: - INDEX - SECURITY example: INDEX default: INDEX RebalanceTypeWithNoConfig: additionalProperties: false type: object required: - method properties: method: type: string enum: - FIXED_WEIGHT - EQUAL_WEIGHT FreeFloatRebalanceConfig: additionalProperties: false type: object required: - method properties: method: type: string enum: - FREE_FLOAT default: FREE_FLOAT max_weight: type: number RebalanceMethodConfig: additionalProperties: false oneOf: - $ref: '#/components/schemas/FreeFloatRebalanceConfig' - $ref: '#/components/schemas/RebalanceTypeWithNoConfig' WeeklyRebalanceDates: additionalProperties: false required: - day type: object properties: day: type: string enum: - Monday - Tuesday - Wednesday - Thursday - Friday WeeklyRebalanceDateConfig: additionalProperties: false allOf: - type: object required: - frequency properties: frequency: type: string enum: - WEEKLY default: WEEKLY roll_forward: type: boolean default: true - $ref: '#/components/schemas/WeeklyRebalanceDates' InitialMonthConfig: additionalProperties: false type: object required: - frequency properties: roll_forward: type: boolean default: true frequency: type: string pattern: ^(ANNUAL|QUARTERLY|SEMIANNUAL|MONTHLY)$ starting_month: type: string enum: - January - February - March - April - May - June - July - August - September - October - November - December SimpleRebalanceDateConfigOptions: additionalProperties: false allOf: - $ref: '#/components/schemas/InitialMonthConfig' - type: object required: - method properties: method: type: string enum: - FIRST BUSINESS DAY - LAST BUSINESS DAY XthDayRebalanceDateConfig: additionalProperties: false allOf: - $ref: '#/components/schemas/InitialMonthConfig' - type: object required: - method properties: method: type: string enum: - XTH CALENDAR DAY xth_day: type: integer minimum: 1 maximum: 31 AdvancedRebalanceDateConfig: additionalProperties: false required: - method - xth_week - day allOf: - $ref: '#/components/schemas/InitialMonthConfig' - type: object properties: method: type: string enum: - ADVANCED default: ADVANCED xth_week: type: string enum: - First - Second - Third - Fourth - Last roll_forward: type: boolean default: true - $ref: '#/components/schemas/WeeklyRebalanceDates' PeriodicDateConfig: additionalProperties: false oneOf: - $ref: '#/components/schemas/WeeklyRebalanceDateConfig' - $ref: '#/components/schemas/AdvancedRebalanceDateConfig' - $ref: '#/components/schemas/SimpleRebalanceDateConfigOptions' - $ref: '#/components/schemas/XthDayRebalanceDateConfig' CalendarAlias: type: string enum: - default - Canada - Euronext Paris - Europe - US - Transatlantic LegacyStaticBasketCalendarConfig: type: object required: - calendar_identifiers properties: calendar_identifiers: type: array items: $ref: '#/components/schemas/CalendarAlias' holidays_to_add: type: array items: $ref: '#/components/schemas/IsoDate' holidays_to_remove: type: array items: $ref: '#/components/schemas/IsoDate' StaticBasketCalendarConfig: type: object required: - swaps_monitor_codes properties: swaps_monitor_codes: type: array items: type: string holidays_to_add: type: array items: $ref: '#/components/schemas/IsoDate' holidays_to_remove: type: array items: $ref: '#/components/schemas/IsoDate' ClientStaticBasketSpecific: type: object additionalProperties: false required: - base_value - return_type - reinvestment_time - reinvestment_type - rebalance_config - constituents - apply_mcap_screen properties: base_value: type: number return_type: type: string enum: - total_return - price_return - net_total_return reinvestment_time: $ref: '#/components/schemas/ReinvestmentTime' default: AT_CLOSE reinvestment_type: $ref: '#/components/schemas/ReinvestmentType' default: INDEX rebalance_config: $ref: '#/components/schemas/RebalanceConfig' apply_mcap_screen: type: boolean description: set to true if the index should apply a 15% min market cap screen default: true restrict_base_date: type: boolean description: won't let user create a basket with base date before at least 70% of basket's IPO dates default: true constituents: type: array items: type: object required: - identifier - identifier_type properties: identifier: title: Identifier type: string identifier_type: $ref: '#/components/schemas/PositionIdentifierType' amount: type: number minimum: 0 maximum: 100 rebalance_calendar: $ref: '#/components/schemas/HolidayCalendarSpec' holiday_calendar_config: type: object oneOf: - $ref: '#/components/schemas/LegacyStaticBasketCalendarConfig' - $ref: '#/components/schemas/StaticBasketCalendarConfig' RebalanceConfig: type: object required: - rebalance_dates - rebalance_method - selection_dates properties: rebalance_method: $ref: '#/components/schemas/RebalanceMethodConfig' rebalance_dates: $ref: '#/components/schemas/PeriodicDateConfig' selection_dates: type: string enum: - rebalance_date - prev_month - prev_week ClientSSTRSpecific: type: object additionalProperties: false required: - ric properties: ric: description: set to the RIC of the underlying equity example: LMVH.PA type: string reinvestment_type: $ref: '#/components/schemas/ReinvestmentTime' default: AT_OPEN ClientDecrementSpecific: type: object additionalProperties: false required: - fee_value - fee_type - day_count_convention - underlying properties: fee_value: description: set to the value of the fee to apply. For fixed, this is bps, for percentage_pre/post this is given as a percentage example: 0.05 type: number fee_type: type: string description: set to the type of fee to apply enum: - fixed - percentage_pre - percentage_post - fixed_points_underlying example: fixed day_count_convention: type: string description: must either adapt to a fixed number of days in a year e.g. 'f360' or to Actual ISDA convention, i.e. 'actual' example: f360 underlying: $ref: '#/components/schemas/ClientDecrementUnderlying' example: identifier_type: RIC identifier: COST.OQ start_date: type: string format: date description: set to the start date of the index if it is to differ from base_date. If this is specified, it must be before base_date. In this case the base_date, base_value is used as a fixed intercept, with the index level starting from start_date and passing through that intercept example: 2004-01-04 ClientDecrementUnderlyingIDType: type: string description: currently supported identifier types for decrement underlyings enum: - RIC - MERQUBE_INDEX example: RIC ClientDecrementUnderlying: type: object additionalProperties: false required: - identifier_type - identifier properties: identifier_type: $ref: '#/components/schemas/ClientDecrementUnderlyingIDType' identifier: type: string example: COST.OQ LevelOverride: type: object additionalProperties: false required: - date - level properties: date: $ref: '#/components/schemas/IsoDate' level: type: number comment: type: string example: date: '2022-03-18' level: 1364.344 comment: test for some special day for some special reason ClientEBCoraxConfig: type: object description: how to handle corporate actions additionalProperties: false properties: reinvest_dividends: type: boolean default: true example: false reinvest_dividend_type: type: string enum: - INDEX - SECURITY - CASH deduct_tax: type: boolean default: false reinvest_day: type: string enum: - AT_OPEN - AT_CLOSE default: AT_OPEN ClientMultiEBSpecific: type: object additionalProperties: false properties: corporate_actions: $ref: '#/components/schemas/ClientEBCoraxConfig' # this is how you get pydantic to output a good default: default_factory: ClientEBCoraxConfig level_overrides: description: optional level overrides for the index on certain days. type: array items: $ref: '#/components/schemas/LevelOverride' example: - date: '2022-03-18' level: 1364.344 comment: test for some special day for some special reason tick_configuration: description: config for the intraday index ticking start/end hour/minutes $ref: '#/components/schemas/TickConfiguration' rebal_freq: $ref: '#/components/schemas/RebalFrequency' precision_level: description: used to set the rounding decimal field when creating identifiers type: integer minimum: 0 dissemination_settings: description: array of configurations for setting up identifiers for individual providers type: array items: $ref: '#/components/schemas/DisseminationSetting' DisseminationSetting: description: configuration for setting up identifier to provider type: object additionalProperties: false required: - destination - ticker properties: destination: type: string enum: - BLOOMBERG - REFINITIV - MORNINGSTAR - FACTSET ticker: type: string TickConfiguration: description: configuration for intraday index ticking time information type: object additionalProperties: false properties: intraday_timezone: type: string default: US/Eastern example: US/Eastern tick_start_hour: type: integer description: hour the index will start ticking intraday minimum: 0 maximum: 23 tick_start_minute: type: integer description: minute the index will start ticking intraday minimum: 0 maximum: 59 tick_end_hour: type: integer description: hour the index will end ticking intraday minimum: 0 maximum: 23 tick_end_minute: type: integer description: minute the index will end ticking intraday minimum: 0 maximum: 59 ClientRuntimeInfo: description: represents index runtime info, which must be specified for some indices (but auto derived for others based on exchange close times etc) type: object additionalProperties: false required: - run_hour - run_minute properties: run_hour: type: integer description: set to the hour of day to run the index in the index's timezone example: 16 run_minute: type: integer description: 'set to the minute of the hour to run the index ' example: 30 timezone: type: string description: set to the timezone of the index default: US/Eastern example: US/Eastern ClientMultiEBPortUpdate: type: object title: ClientMultiEBPortUpdate additionalProperties: false required: - constituents properties: constituents: type: array items: $ref: '#/components/schemas/DatedValidEquityBasketPosition' description: The EB portfolio directory example: - date: '2022-03-11' identifier_type: RIC identifier: AAPL.OQ quantity: -0.2512355 security_type: EQUITY - date: '2022-03-11' identifier_type: RIC identifier: USD quantity: 60.0 security_type: CASH default_factory: list unit_of_measure: $ref: '#/components/schemas/PortfolioUom' default: SHARES index_currency: type: string ClientMultiEBPortConfig: allOf: # initial includes base date/val, then all the constituents. updates dont need base - $ref: '#/components/schemas/ClientMultiEBPortUpdate' - $ref: '#/components/schemas/ClientBaseVal' IdTransactionCost: type: object additionalProperties: false required: - merq_id properties: merq_id: type: string description: > Deterministic identifier. Two allowed shapes: 1) fsym_id+country_code form: el:::0 2) ticker: in::0 Examples: 'el:R85KLC:US:0', 'in:AAPL:0' examples: - el:R85KLC:US:0 - in:AAPL:0 cost_floor: type: number default: 0.0 minimum: 0.0 maximum: 1.0 vol_factor: type: number default: 0.0 minimum: 0.0 maximum: 1.0 TransactionCostsConfig: type: object additionalProperties: false properties: transaction_cost_activated: type: boolean default: false pool_cash: type: boolean default: false individual_transaction_cost: type: object additionalProperties: $ref: '#/components/schemas/IdTransactionCost' ClientBufferSpecific: type: object additionalProperties: false description: properties specific to buffer indices required: - protection_start - protection_end - roll_freq - root properties: protection_start: description: losses on the underlying are incurred up to protection_start, the portfolio is protected against losses between protection_start and protection_end, and then losses after protection_end are also incurred. These are represented as percentages of the underlying. Eg on start=95 and end=70 (sometimes a called a 5/30 buffer), the first 5% of losses are incurred, the portfolio is protected between -5% and -30%, then losses after 30% are added to 5% and are incurred. In this example, if the underlying drops 32%, the index will lose 7%. type: number minimum: 0 maximum: 100.0 example: 95.0 protection_end: description: eg the 30 in the above example. Must be < protection_start. type: number minimum: 0.0 maximum: 100.0 example: 70.0 roll_freq: description: frequency in months of the options roll type: integer minimum: 1 example: 3 default: 12 root: description: the root of the options type: string enum: - SPY - QQQ - IWM - EFA - EEM - TLT - LQD - HYG - GLD example: SPY OptionRoot: type: string enum: - SPY - QQQ - IWM - EFA - EEM - TLT - LQD - HYG - GLD ClientOptionStrategiesBase: description: A options strategy index type: object additionalProperties: false required: - strategy_type - underliers - strategy_options properties: strategy_type: description: The type of strategy $ref: '#/components/schemas/OptionStrategyType' underliers: description: The underlying assets of the strategy type: array minItems: 1 items: oneOf: - $ref: '#/components/schemas/FsymAndCountry' - $ref: '#/components/schemas/IndexTicker' strategy_options: description: List of options in the strategy and their configs type: array items: $ref: '#/components/schemas/ClientStrategyOption' hold_underlier: type: boolean default: true interest_rate_config: description: configuration for interest rates on an options strategy self service index $ref: '#/components/schemas/IndexInterestRateConfig' early_exercise: $ref: '#/components/schemas/ClientStrategyOptionEarlyExercise' transaction_cost_spec: $ref: '#/components/schemas/TransactionCostsConfig' ClientSingleOptionBase: description: a single option strategy type: object additionalProperties: false required: - rebalancing_strategy - exposure properties: rebalancing_strategy: description: the rebalancing schedule type: string enum: - weekly_Monday - weekly_Tuesday - weekly_Wednesday - weekly_Thursday - weekly_Friday - monthly_End_Of_Month - monthly_3rd_Friday root: description: the root of the option; more roots may be supported in the future $ref: '#/components/schemas/OptionRoot' default: SPY example: SPY option_underlying: description: the underlying option to use; if not specified the default is to use the `root` $ref: '#/components/schemas/OptionRoot' example: SPY exposure: description: percentage of the underlying you want exposure to type: number minimum: 0.0 IndexInterestRateConfig: description: configuration for an index's interest rates including both lending/borrowing rates type: object additionalProperties: false required: - lending_rate - borrowing_rate properties: lending_rate: $ref: '#/components/schemas/InterestRateConfig' borrowing_rate: $ref: '#/components/schemas/InterestRateConfig' InterestRateConfig: description: configuration for an interest rate type: object additionalProperties: false oneOf: - $ref: '#/components/schemas/ConstantInterestRateConfig' - $ref: '#/components/schemas/VariableInterestRateConfig' discriminator: propertyName: type mapping: constant: '#/components/schemas/ConstantInterestRateConfig' variable: '#/components/schemas/VariableInterestRateConfig' ConstantInterestRateConfig: description: configuration for constant interest rates on options strategy self serve indices type: object additionalProperties: false required: - rate properties: rate: type: number VariableInterestRateConfig: description: configuration for variable interest rates on options strategy self serve indices type: object additionalProperties: false required: - reference_rate - spread properties: reference_rate: type: string enum: - SOFR - EFFR spread: type: number is_constant: type: boolean default: false description: Used to determine if the rate value is to be set once per rebalance period or changed every day # these models are split like this so that we get automatic validation / bounds for 'options' which depends on a 4-choice combo of two parameters # it looks repetetive, but structured like this, both the UI and the CLI will get instant validation of 'options' based on 'method' and 'options_method' # if instead we had just allowed the user to select "options, method, options_method", all these validation rules would be buried inside of the indexapi logic # and the UI would not offer any assistance ClientCoveredStrike: description: A covered strike strategy with the strike being percentage of the spot. Covers by selling a call. type: object additionalProperties: false required: - options properties: options: type: number minimum: 0.0 method: type: string enum: - Covered default: Covered example: Covered options_method: type: string enum: - Strike default: Strike example: Strike ClientCoveredDelta: type: object additionalProperties: false description: A covered delta strategy with a call delta between 0 and 1. Covers by selling a call. required: - options properties: options: type: number minimum: 0.0 maximum: 100.0 method: type: string enum: - Covered default: Covered example: Covered options_method: type: string enum: - Delta default: Delta example: Delta ClientDownsideStrike: type: object additionalProperties: false description: A downside strike strategy with the strike being percentage of the spot. Protects downside by buying a put. required: - options properties: options: type: number minimum: 0.0 method: type: string enum: - Downside default: Downside example: Downside options_method: type: string enum: - Strike default: Strike example: Strike ClientDownsideDelta: type: object additionalProperties: false description: A downside delta strategy with the delta being percentage of the spot. Protects downside by buying a put. required: - options properties: options: type: number minimum: -100.0 maximum: 0 method: type: string enum: - Downside default: Downside example: Downside options_method: type: string enum: - Delta default: Delta example: Delta OptionExerciseStyle: type: string enum: - EUROPEAN - AMERICAN ClientStrategyOption: type: object additionalProperties: false description: Defines an option in a strategy index for self service flow required: - option_type - trade_type - strike_type - exposure - number_of_tranches - expiry - rebalance - early_exercise properties: option_type: type: string $ref: '#/components/schemas/OptionType' trade_type: type: string $ref: '#/components/schemas/TradeType' strike_type: type: string $ref: '#/components/schemas/StrategyOptionStrikeType' strike_value: type: number minimum: 0 exposure: type: number minimum: 0 number_of_tranches: type: integer minimum: 1 expiry: $ref: '#/components/schemas/ClientStrategyOptionExpiry' rebalance: oneOf: - $ref: '#/components/schemas/ClientStrategyOptionRebalanceRelativeToExpiry' - $ref: '#/components/schemas/ClientStrategyOptionRebalanceCertainDay' is_financing: type: boolean default: false is_spread: type: boolean default: false spread_lower_bound: type: number spread_upper_bound: type: number ClientStrategyOptionExpiry: type: object additionalProperties: false description: Defines expiry-related configs for options strategies self service flow required: - expiry_period_type - time_period_away properties: expiry_period_type: type: string $ref: '#/components/schemas/StrategyOptionExpiryPeriodType' time_period_away: type: integer minimum: 1 day_of_week: type: string $ref: '#/components/schemas/DayOfWeek' description: Should only be set if expiry_time_period is WEEKLY EarlyExerciseTreatment: type: string enum: - KEEP_IN_CASH - RESTRIKE_AT_DAYS - CONDITION_RESTRIKE_AT_DAYS ClientStrategyOptionEarlyExercise: type: object additionalProperties: false description: Defines the Early Exercise Strategy required: - enabled properties: enabled: type: boolean default: false treatment: $ref: '#/components/schemas/EarlyExerciseTreatment' restrike_days: type: integer minimum: 1 borrowing_rate: type: number minimum: 0.0 rebalancing_period: type: integer minimum: 1 ClientStrategyOptionRebalanceRelativeToExpiry: type: object additionalProperties: false description: Defines rebalance-related configs for options strategies self service flow, if user selects "Relative to Expiry" required: - schedule_type - days_before_expiry - roll_back properties: schedule_type: type: string enum: - REL_TO_EXPIRY days_before_expiry: type: integer minimum: 0 roll_back: type: boolean description: Whether or not to roll back or roll forward if date is a holiday ClientStrategyOptionRebalanceCertainDay: type: object additionalProperties: false description: Defines rebalance-related configs for option strategies self service flow, if user selects "Certain Day" required: - schedule_type - time_period_away - day_of_week - roll_back properties: schedule_type: type: string enum: - CERTAIN_DAY time_period_away: type: integer minimum: 1 day_of_week: type: string $ref: '#/components/schemas/DayOfWeek' week_of_month: type: integer minimum: 1 maximum: 4 roll_back: type: boolean description: Whether or not to roll back or roll forward if date is a holiday # full client models # Self Service Option Strategies Models ClientOptionStrategiesConfig: description: A Option strategies index title: ClientOptionStrategiesConfig type: object additionalProperties: false allOf: - $ref: '#/components/schemas/ClientOptionStrategiesBase' - $ref: '#/components/schemas/ClientRuntimeInfo' - $ref: '#/components/schemas/ClientIndexConfigBase' ClientSingleOptionConfig: description: a single option strategy title: ClientSingleOptionConfig type: object additionalProperties: false allOf: - $ref: '#/components/schemas/ClientSingleOptionBase' - type: object additionalProperties: false required: - strategy properties: strategy: oneOf: - $ref: '#/components/schemas/ClientCoveredStrike' - $ref: '#/components/schemas/ClientCoveredDelta' - $ref: '#/components/schemas/ClientDownsideStrike' - $ref: '#/components/schemas/ClientDownsideDelta' - $ref: '#/components/schemas/ClientRuntimeInfo' - $ref: '#/components/schemas/ClientIndexConfigBase' ClientStaticBasketConfig: description: full config for Static Basket Indices type: object additionalProperties: false allOf: - $ref: '#/components/schemas/ClientStaticBasketSpecific' - $ref: '#/components/schemas/ClientEquityBasketConfigBase' ClientSSTRConfig: description: full config for SSTRs type: object additionalProperties: false allOf: - $ref: '#/components/schemas/ClientSSTRSpecific' - $ref: '#/components/schemas/ClientEquityBasketConfigBase' ClientDecrementConfig: description: full config for decrements type: object additionalProperties: false allOf: - $ref: '#/components/schemas/ClientDecrementSpecific' - $ref: '#/components/schemas/ClientEquityBasketConfigBase' ClientMultiEBConfig: description: full config for equity baskets type: object title: ClientMultiEBConfig additionalProperties: false allOf: - $ref: '#/components/schemas/ClientMultiEBPortConfig' - $ref: '#/components/schemas/ClientMultiEBSpecific' - $ref: '#/components/schemas/ClientRuntimeInfo' - $ref: '#/components/schemas/ClientEquityBasketConfigBase' ClientBufferConfig: description: full config for buffer indices type: object additionalProperties: false allOf: - $ref: '#/components/schemas/ClientBufferSpecific' - $ref: '#/components/schemas/ClientRuntimeInfo' - $ref: '#/components/schemas/ClientIndexConfigBase' ClientEquityIndexConfig: description: full config for equity indices type: object additionalProperties: false allOf: - $ref: '#/components/schemas/ClientEquityIndexSpecific' - $ref: '#/components/schemas/ClientEquityIndexConfigBase' ClientEquityIndexSpecific: type: object additionalProperties: false required: - currency - return_type - reinvestment_strategy - reinvestment_time - reinvestment_type - holiday_calendar - rebalance_config - allocation_units properties: currency: type: string return_type: type: string enum: - total_return - price_return - net_total_return reinvestment_time: $ref: '#/components/schemas/ReinvestmentTime' reinvestment_type: $ref: '#/components/schemas/ReinvestmentType' holiday_calendar: $ref: '#/components/schemas/HolidayCalendarSpec' rebalance_config: $ref: '#/components/schemas/RebalanceConfig' allocation_units: type: array items: $ref: '#/components/schemas/AllocationUnit' description: The allocation units for the index, which define how the index constituents are grouped and weighted allocation_weight_type: type: string enum: - FIXED_WEIGHT - EQUAL_WEIGHT default: FIXED_WEIGHT description: The way weight should be assigned to each allocation unit CountryOfDomicileFilterSpec: type: object additionalProperties: false required: - type - domicile_countries - include_or_exclude properties: type: type: string enum: - country_of_domicile domicile_countries: type: array items: type: string include_or_exclude: type: string enum: - INCLUDE - EXCLUDE description: Whether to include or exclude the specified countries CountryOfExchangeFilterSpec: type: object additionalProperties: false required: - type - exchange_countries - include_or_exclude properties: type: type: string enum: - country_of_exchange exchange_countries: type: array items: type: string include_or_exclude: type: string enum: - INCLUDE - EXCLUDE description: Whether to include or exclude the specified countries MicFilterSpec: type: object additionalProperties: false required: - type - mics - include_or_exclude properties: type: type: string enum: - mic mics: type: array items: type: string include_or_exclude: type: string enum: - INCLUDE - EXCLUDE description: Whether to include or exclude the specified MIC codes CurrencyFilterSpec: type: object additionalProperties: false required: - type - currencies - include_or_exclude properties: type: type: string enum: - currency currencies: type: array items: type: string include_or_exclude: type: string enum: - INCLUDE - EXCLUDE description: Whether to include or exclude the specified currencies SectorFilterSpec: type: object additionalProperties: false required: - type - sectors - include_or_exclude properties: type: type: string enum: - sector sectors: type: array items: type: string include_or_exclude: type: string enum: - INCLUDE - EXCLUDE description: Whether to include or exclude the specified sectors SubSectorFilterSpec: type: object additionalProperties: false required: - type - sub_sectors - include_or_exclude properties: type: type: string enum: - sub_sector sub_sectors: type: array items: type: string include_or_exclude: type: string enum: - INCLUDE - EXCLUDE description: Whether to include or exclude the specified sub-sectors TRBCFilterSpec: type: object additionalProperties: false required: - type - trbc_codes - include_or_exclude properties: type: type: string enum: - trbc trbc_codes: type: array items: type: integer description: TRBC codes to filter by include_or_exclude: type: string enum: - INCLUDE - EXCLUDE description: Whether to include or exclude the specified TRBC codes MarketCapFilterSpec: type: object additionalProperties: false required: - type - currency - mkt_cap_type properties: type: type: string enum: - market_cap currency: type: string mkt_cap_type: type: string enum: - total_mkt_cap - float_mkt_cap threshold_retention_min: type: number format: float threshold_retention_max: type: number format: float threshold_addition_min: type: number format: float threshold_addition_max: type: number format: float Advt3mFilterSpec: type: object additionalProperties: false required: - type - currency properties: type: type: string enum: - advt_3m currency: type: string threshold_retention_min: type: number format: float threshold_retention_max: type: number format: float threshold_addition_min: type: number format: float threshold_addition_max: type: number format: float MarketCapPercentFilterSpec: type: object additionalProperties: false required: - type - mkt_cap_type properties: type: type: string enum: - mkt_cap_percent mkt_cap_type: type: string enum: - total_mkt_cap - float_mkt_cap threshold_retention_min: type: number format: float minimum: 0.0 maximum: 100.0 threshold_retention_max: type: number format: float minimum: 0.0 maximum: 100.0 threshold_addition_min: type: number format: float minimum: 0.0 maximum: 100.0 threshold_addition_max: type: number format: float minimum: 0.0 maximum: 100.0 StaticListingExclusionFilterSpec: type: object additionalProperties: false required: - type - static_listings properties: type: type: string enum: - static_listing_exclusion static_listings: type: array items: $ref: '#/components/schemas/FsymAndCountry' ListingWeightCap: type: object additionalProperties: false required: - fsym_id - exchange_country - weight_cap properties: fsym_id: type: str exchange_country: type: string weight_cap: type: number format: float minimum: 0.0 maximum: 100.0 ListingWeightFloor: type: object additionalProperties: false required: - fsym_id - exchange_country - weight_cap properties: fsym_id: type: str exchange_country: type: string weight_floor: type: number format: float minimum: 0.0 maximum: 100.0 ListingFixedWeight: type: object additionalProperties: false required: - fsym_id - exchange_country - fixed_weight properties: fsym_id: type: string exchange_country: type: string fixed_weight: type: number format: float minimum: 0.0 maximum: 100.0 WeightingSpec: type: object additionalProperties: false required: - weighting_strategy properties: weighting_strategy: type: string enum: - equal_weight - total_mkt_cap - float_mkt_cap - fixed - advt_3m default_weight_cap: type: number format: float description: The overall weight cap for the allocation unit, if applicable default_weight_floor: type: number format: float description: Default minimum stock weight for any stock listing_weight_caps: type: array items: $ref: '#/components/schemas/ListingWeightCap' default: [] listing_weight_floors: type: array items: $ref: '#/components/schemas/ListingWeightFloor' default: [] fixed_weight_listings: type: array items: $ref: '#/components/schemas/ListingFixedWeight' default: [] AllocationUnit: type: object additionalProperties: false required: - allocation_type - allocation_name - weighting properties: allocation_type: type: string enum: - mkt_cap_sorted - parent_universe - static allocation_name: type: string description: The name of the allocation unit allocation_weight: type: number format: float minimum: 0.0 maximum: 100.0 sort_metric: type: string enum: - total_mkt_cap - float_mkt_cap - advt_3m default: total_mkt_cap parent_index: type: string description: The parent index for the allocation unit, if applicable weighting: $ref: '#/components/schemas/WeightingSpec' number_of_listings: type: integer description: The number of listings in the allocation unit, if null select all that apply ignore_double_listings: type: boolean static_listings: type: array items: type: object required: - identifier - identifier_type properties: identifier: title: Identifier type: string identifier_type: $ref: '#/components/schemas/PositionIdentifierType' amount: type: number minimum: 0 maximum: 100 allocation_screens: type: array items: oneOf: - $ref: '#/components/schemas/CountryOfDomicileFilterSpec' - $ref: '#/components/schemas/CountryOfExchangeFilterSpec' - $ref: '#/components/schemas/MicFilterSpec' - $ref: '#/components/schemas/CurrencyFilterSpec' - $ref: '#/components/schemas/SectorFilterSpec' - $ref: '#/components/schemas/SubSectorFilterSpec' - $ref: '#/components/schemas/TRBCFilterSpec' - $ref: '#/components/schemas/MarketCapFilterSpec' - $ref: '#/components/schemas/Advt3mFilterSpec' - $ref: '#/components/schemas/MarketCapPercentFilterSpec' - $ref: '#/components/schemas/StaticListingExclusionFilterSpec' NotificationConfig: type: object additionalProperties: false properties: emails: type: array items: type: string email_list_uuid: type: string enabled: type: boolean # Defined Outcomes Helper Models ClientDefinedOutcomeScheduleType: type: string enum: - CERTAIN_DAY - MONTH_END - THIRD_FRIDAY ClientDefinedOutcomeExpiryPeriodType: type: string enum: - MONTHS - WEEKS ClientDefinedOutcomeRebalancer: type: object additionalProperties: false required: - schedule_type - time_period_away - roll_back properties: roll_back: type: boolean schedule_type: type: string $ref: '#/components/schemas/ClientDefinedOutcomeScheduleType' day_of_week: type: string $ref: '#/components/schemas/DayOfWeek' week_of_month: type: integer minimum: 1 maximum: 5 time_period_away: type: integer minimum: 0 days_before_expiry: type: integer minimum: 0 ClientDefinedOutcomeExpiry: type: object additionalProperties: false required: - expiry_period_type - expiry_period_value properties: expiry_period_type: type: string $ref: '#/components/schemas/ClientDefinedOutcomeExpiryPeriodType' expiry_period_value: type: number minimum: 0 ClientDefinedOutcomeOptionType: type: string enum: - PUT - CALL ClientDefinedOutcomeTradeType: type: string enum: - BUY - SELL ClientDefinedOutcomeStrikeType: type: string enum: - DELTA - PCT_SPOT - INCOME ClientDefinedOutcomeRoots: type: string enum: - SPY - QQQ - IWM - EFA - XIU - TLT - HYG - EEM - LQD - VOO - IVV - SPX - VTWO - BITO - IBIT - MSFT - AMZN - TSLA - META - AAPL - NVDA - GOOGL - GOOG - GLD ClientDefinedOutcomeOption: type: object additionalProperties: false required: - strike_type - option_type - trade_type - strike_value - root - exercise_style properties: strike_type: type: string $ref: '#/components/schemas/ClientDefinedOutcomeStrikeType' option_type: type: string $ref: '#/components/schemas/ClientDefinedOutcomeOptionType' trade_type: type: string $ref: '#/components/schemas/ClientDefinedOutcomeTradeType' strike_value: type: number minimum: 0 root: type: string $ref: '#/components/schemas/ClientDefinedOutcomeRoots' exercise_style: type: string $ref: '#/components/schemas/OptionExerciseStyle' exposure: type: number minimum: 0 ClientDefinedOutcomeParticipationRateStrategyOption: type: object additionalProperties: false required: - exercise_style - exposure - option_type - ETF - strike allOf: - $ref: '#/components/schemas/ClientDefinedOutcomeOption' ClientDefinedOutcomeParticipationRateStrategy: type: object additionalProperties: false required: - strategy - max_participation - option properties: strategy: type: string pattern: ^PARTICIPATION_RATE$ max_participation: type: number minimum: 0 default: 200 option: type: object $ref: '#/components/schemas/ClientDefinedOutcomeParticipationRateStrategyOption' ClientDefinedOutcomeNoEtfStrategy: type: object additionalProperties: false required: - strategy - min_cap properties: strategy: type: string pattern: ^NO_ETF$ min_cap: type: number minimum: 0 default: 0 ClientDefinedOutcomeCashStrategy: type: object additionalProperties: false required: - strategy properties: strategy: type: string pattern: ^CASH$ ClientDefinedOutcomeBufferStrategyItem: type: object additionalProperties: false required: - options - rebalancer - number_of_tranches - expiry properties: options: type: array items: - $ref: '#/components/schemas/ClientDefinedOutcomeOption' expiry: type: object $ref: '#/components/schemas/ClientDefinedOutcomeExpiry' rebalancer: type: object $ref: '#/components/schemas/ClientDefinedOutcomeRebalancer' number_of_tranches: type: integer minimum: 1 description: Number of tranches in the strategy strategy_type: type: string enum: - CUSTOM - ACCELERATOR - BUFFER interest_rate_config: description: configuration for interest rates on an options strategy self service index $ref: '#/components/schemas/IndexInterestRateConfig' self_financing_strategy: type: object additionalProperties: false oneOf: - $ref: '#/components/schemas/ClientDefinedOutcomeParticipationRateStrategy' - $ref: '#/components/schemas/ClientDefinedOutcomeNoEtfStrategy' discriminator: propertyName: strategy mapping: PARTICIPATION_RATE: '#/components/schemas/ClientDefinedOutcomeParticipationRateStrategy' NO_ETF: '#/components/schemas/ClientDefinedOutcomeNoEtfStrategy' ClientDefinedOutcomeBufferStrategy: type: object additionalProperties: false required: - option_strategies properties: option_strategies: type: array items: - $ref: '#/components/schemas/ClientDefinedOutcomeBufferStrategyItem' minItems: 1 maxItems: 1 ClientDefinedOutcomeAcceleratorStrategyItem: type: object additionalProperties: false required: - options - rebalancer - number_of_tranches - expiry properties: options: type: array items: - $ref: '#/components/schemas/ClientDefinedOutcomeOption' minItems: 2 maxItems: 2 expiry: type: object $ref: '#/components/schemas/ClientDefinedOutcomeExpiry' rebalancer: type: object $ref: '#/components/schemas/ClientDefinedOutcomeRebalancer' number_of_tranches: type: integer minimum: 1 description: Number of tranches in the strategy strategy_type: type: string enum: - CUSTOM - ACCELERATOR - BUFFER interest_rate_config: description: configuration for interest rates on an options strategy self service index $ref: '#/components/schemas/IndexInterestRateConfig' self_financing_strategy: type: object $ref: '#/components/schemas/ClientDefinedOutcomeNoEtfStrategy' ClientDefinedOutcomeAcceleratorStrategy: type: object additionalProperties: false required: - option_strategies properties: option_strategies: type: array items: - $ref: '#/components/schemas/ClientDefinedOutcomeAcceleratorStrategyItem' minItems: 1 maxItems: 1 ClientDefinedOutcomeCustomStrategyItem: type: object additionalProperties: false required: - options - rebalancer - number_of_tranches - expiry properties: options: type: array items: - $ref: '#/components/schemas/ClientDefinedOutcomeOption' minItems: 1 expiry: type: object $ref: '#/components/schemas/ClientDefinedOutcomeExpiry' rebalancer: type: object $ref: '#/components/schemas/ClientDefinedOutcomeRebalancer' number_of_tranches: type: integer minimum: 1 description: Number of tranches in the strategy strategy_type: type: string enum: - CUSTOM - ACCELERATOR - BUFFER self_financing_strategy: type: object additionalProperties: false oneOf: - $ref: '#/components/schemas/ClientDefinedOutcomeParticipationRateStrategy' - $ref: '#/components/schemas/ClientDefinedOutcomeNoEtfStrategy' - $ref: '#/components/schemas/ClientDefinedOutcomeCashStrategy' discriminator: propertyName: strategy mapping: PARTICIPATION_RATE: '#/components/schemas/ClientDefinedOutcomeParticipationRateStrategy' NO_ETF: '#/components/schemas/ClientDefinedOutcomeNoEtfStrategy' CASH: '#/components/schemas/ClientDefinedOutcomeCashStrategy' ClientDefinedOutcomeCustomStrategy: type: object additionalProperties: false required: - option_strategies properties: option_strategies: type: array items: - $ref: '#/components/schemas/ClientDefinedOutcomeCustomStrategyItem' minItems: 1 maxItems: 1 starting_cash: type: number minimum: 0 description: The starting cash for the custom strategy, used to fund the options default: 0 underliers: description: The underlying assets of the strategy type: array minItems: 0 maxItems: 1 items: oneOf: - $ref: '#/components/schemas/FsymAndCountry' - $ref: '#/components/schemas/IndexTicker' interest_rate_config: description: configuration for interest rates on an options strategy self service index $ref: '#/components/schemas/IndexInterestRateConfig' # Defined Outcomes Base models ClientDefinedOutcomeBufferBase: description: A Defined Outcome Buffer Base type: object additionalProperties: false allOf: - $ref: '#/components/schemas/ClientDefinedOutcomeBufferStrategy' - type: object additionalProperties: false required: - strategy_type properties: strategy_type: type: string enum: - BUFFER ClientDefinedOutcomeAcceleratorBase: description: A Defined Outcome Accelerator Base type: object additionalProperties: false allOf: - $ref: '#/components/schemas/ClientDefinedOutcomeAcceleratorStrategy' - type: object additionalProperties: false required: - strategy_type properties: strategy_type: type: string enum: - ACCELERATOR ClientDefinedOutcomeCustomStrategyBase: description: A Defined Outcome Custom Strategy Base type: object additionalProperties: false allOf: - $ref: '#/components/schemas/ClientDefinedOutcomeCustomStrategy' - type: object additionalProperties: false required: - strategy_type properties: strategy_type: type: string enum: - CUSTOM # Defined Outcomes API models ClientDefinedOutcomeBufferConfig: description: base config for defined outcome indices type: object additionalProperties: false properties: use_maf: type: boolean default: false currency: type: string allOf: - $ref: '#/components/schemas/ClientDefinedOutcomeBufferBase' - $ref: '#/components/schemas/ClientRuntimeInfo' - $ref: '#/components/schemas/ClientIndexConfigBase' ClientDefinedOutcomeAcceleratorConfig: description: base config for defined outcome indices type: object additionalProperties: false properties: use_maf: type: boolean default: false currency: type: string allOf: - $ref: '#/components/schemas/ClientDefinedOutcomeAcceleratorBase' - $ref: '#/components/schemas/ClientRuntimeInfo' - $ref: '#/components/schemas/ClientIndexConfigBase' ClientDefinedOutcomeCustomStrategyConfig: description: base config for defined outcome indices with custom strategies type: object additionalProperties: false properties: use_maf: type: boolean default: false currency: type: string allOf: - $ref: '#/components/schemas/ClientDefinedOutcomeCustomStrategyBase' - $ref: '#/components/schemas/ClientRuntimeInfo' - $ref: '#/components/schemas/ClientIndexConfigBase' OptionsUnderlierItem: type: object additionalProperties: false required: - name properties: name: type: string OptionsUnderlierGet: type: object additionalProperties: false required: - allowed_underliers properties: allowed_underliers: type: array items: type: object $ref: '#/components/schemas/OptionsUnderlierItem' # parameters MerqTimestamp: # https://www.regextester.com/109110 # https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times # json schema does not support milliseconds! # hence we use a custom regex to capture prov_ts with ms anyOf: - type: string format: date-time - type: string format: date - type: string pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}(?:[ T][0-9]{2}:[0-9]{2}:[0-9]{2})?(?:[.][0-9]{1,6})?$ example: - '2021-01-01' - '2021-01-01T01:01:01' - 2021-01-01T01:01:01.zzzzz Status: type: object required: - last_modified properties: created_at: type: string created_by: type: string last_modified: type: string last_modified_by: type: string locked_after: type: string format: date-time description: If this is set (non null), the manifest is locked for all edits to any other field after this timestamp. A PUT/PATCH may be used to first unlock the manifest, by setting this field (to a max of one hour in the future), or to `null` again, to make other edits. calendar_identifiers: type: object properties: calendar_identifiers: type: array items: type: string pattern: ^(FUT|MIC|FX|SM|MQI|OVERLAY):.+$ holidays_to_add: type: object properties: holidays_to_add: type: array items: type: string format: date NestedCalendarSchema: type: object additionalProperties: false required: - operator - children properties: operator: type: string enum: - union - intersection - difference weekmask: type: array items: type: string enum: - Mon - Tue - Wed - Thu - Fri - Sat - Sun description: weekmask of valid business days default: - Mon - Tue - Wed - Thu - Fri children: type: array items: oneOf: - $ref: '#/components/schemas/calendar_identifiers' - $ref: '#/components/schemas/holidays_to_add' - $ref: '#/components/schemas/NestedCalendarSchema' FlatCalendarSchema: type: object additionalProperties: false properties: calendar_identifiers: type: array items: type: string pattern: ^(FUT|MIC|FX|SM|MQI|OVERLAY):.+$ default_factory: list swaps_monitor_codes: type: array items: type: string pattern: ^[a-zA-Z]{3}$ default_factory: list condition: type: string enum: - any - all - custom default: all holidays_to_add: type: array items: type: string format: date default_factory: list holidays_to_remove: type: array items: type: string format: date default_factory: list weekmask: type: array items: type: string enum: - Mon - Tue - Wed - Thu - Fri - Sat - Sun description: weekmask of valid business days default: - Mon - Tue - Wed - Thu - Fri HolidayCalendarSpec: anyOf: - $ref: '#/components/schemas/FlatCalendarSchema' - $ref: '#/components/schemas/NestedCalendarSchema' ArgumentsOrEnvVars: type: array items: type: array items: type: string SubPod: type: object additionalProperties: false properties: arguments: $ref: '#/components/schemas/ArgumentsOrEnvVars' command: type: string pod_type: type: string uuid: type: string env_vars: $ref: '#/components/schemas/ArgumentsOrEnvVars' pod_kwargs: type: object aditionalProperties: true properties: name: type: string required: - command - pod_type - uuid S3Bucket: type: object additionalProperties: false properties: bucket: type: string path: type: string required: - bucket AirflowConfig: type: object additionalProperties: false properties: description: type: string description: A short description related with the generated runner s3_location: $ref: '#/components/schemas/S3Bucket' description: Bucket and path where the generated dag should be stored. If not defined `merq-airflow-dags-airflow2` is defined in merqutil dag: type: object additionalProperties: true description: use this to set kwargs for the dag pod: type: object additionalProperties: true description: use this to set kwargs for the pod env: type: object additionalProperties: true description: use this to set ENV variables in the pod affinity_match_expression_key: type: string description: the affinity to use in airflow subpods: type: array items: $ref: '#/components/schemas/SubPod' DisseminationDestinations: type: object properties: email_dissapi_configs: type: array items: type: object required: - recipient_list - subject properties: recipient_list: type: array items: type: string minItems: 1 email_list: type: array items: type: string bcc_list: type: array items: type: string cc_list: type: array items: type: string subject: type: string content: type: string file_keys: type: array items: type: string minItems: 1 sftp_dissapi_configs: type: array items: type: object required: - sftp_ids - file_keys properties: sftp_ids: type: array items: type: string file_keys: type: array items: type: string s3_dissapi_configs: type: array items: type: object required: - bucket - key_prefix - file_keys properties: bucket: type: string key_prefix: type: string file_keys: type: array items: type: string IndexReport: type: object required: - uuid properties: uuid: type: string program_args: type: object task_id: type: string dissemination_destinations: $ref: '#/components/schemas/DisseminationDestinations' RunConfig: type: object additionalProperties: true required: - schedule - job_enabled - num_days_to_load properties: airflow_config: $ref: '#/components/schemas/AirflowConfig' command: type: string command_arguments: $ref: '#/components/schemas/ArgumentsOrEnvVars' index_report_uuids: type: array items: type: string index_reports: oneOf: - type: array items: type: string minItems: 1 - type: array items: $ref: '#/components/schemas/IndexReport' job_enabled: type: boolean holiday_calendar: $ref: '#/components/schemas/HolidayCalendarSpec' pod_image_and_tag: type: string description: overrides the image schedule: $ref: '#/components/schemas/Schedule' alert_priority: type: string enum: - P1 - P2 - P3 - P4 - P5 tzinfo: type: string num_days_to_load: type: integer day_chunk_size: type: integer description: if set to a number, the index run will be split into chunks of this number of days state_key: type: string minLength: 1 description: ID to use when storing or reading the state of an instance of a dissapi object. dqms: $ref: '#/components/schemas/DqmsConfig' RunConfigLabelAdditional: type: object description: used when there needs to be different run configurations, each with a different label, such as 'initial' vs 'final' required: - label properties: label: type: string description: unique label of this rc RunConfigLabel: type: object additionalProperties: true allOf: - $ref: '#/components/schemas/RunConfig' - $ref: '#/components/schemas/RunConfigLabelAdditional' DqmsConfig: type: object additionalProperties: false properties: enabled: type: boolean description: If true, force-enables DQMS validation for this index Schedule: type: object additionalProperties: false properties: retries: type: integer retry_interval_min: type: integer schedule_start: type: string schedule_cron: type: string timeout_delta: type: string example: minutes=17 business_days_prior: type: integer example: 1 holiday_calendar: type: object properties: cal_type: type: string example: MIC mic: type: string example: XNYS triggers: type: array description: the dataset trigger to which the dag subscribes to. This is a list of trigger(s) items: type: string example: - trigger://exchange/XNYS/early_closing.merq event_driven: type: boolean default: false description: if true, there will be no defined schedule for the DAG (as in you could have a created DAG that won't run unless triggered manually) required: - retries - retry_interval_min - schedule_start CopyFromManifest: type: object description: Creates a new resource by starting from an existing resource, removing the id/status, adding/updating/deleting keys, then posting it as a new resource. The original resource is hereby referred to as the from-manifest. This is essentially a GET-MODIFY-POST operation. Only top level keys can be modifed/replaced/deleted, this does not support subkey modification. required: - copy_from_uuid - name properties: copy_from_uuid: type: string description: the uuid of the resource to start from field_deletes: type: array description: fields to delete from the from-manifest items: type: string field_updates: type: object description: a dictionary of top level keys that the original manifest will be updated with (ie `manifest.update(this[field_updates])`. Top level keys can be added or replaced. To change the namespace, add namespace to the field_updates dict. The new manifest must be valid per the original resource definition. name: type: string description: the name of the new resource # On POST, status is illegal. Subsequently, its always there and required on patch/put. Same with ID. CrudExtra: type: object additionalProperties: false required: - id - status - namespace properties: id: type: string namespace: type: string status: $ref: '#/components/schemas/Status' CountryCode: description: ISO country codes type: string example: US enum: - AE - AR - AT - AU - BD - BE - BG - BH - BR - BW - CA - CH - CI - CL - CN - CO - CY - CZ - DE - DK - EC - EG - ES - FI - FR - GB - GR - HK - HR - HU - ID - IE - IL - IN - IS - IT - JP - KH - KR - KW - LK - LU - MX - MY - NL - NO - NZ - PE - PH - PK - PL - PT - QA - RU - SA - SE - SG - SI - SK - TH - TN - TR - TT - TW - US - VN - ZA - ZM parameters: dataCollectionsNameParam: name: name in: query description: Name of the data collection to query required: true schema: type: string sectypeParam: name: type in: path description: the type of security (futures_root, intraday_index etc) schema: type: string required: true providerParam: name: provider in: path required: true schema: $ref: '#/components/schemas/Provider' startDateParam: name: start_date in: query description: Start date for the results/computation required: false schema: $ref: '#/components/schemas/MerqTimestamp' endDateParam: name: end_date in: query description: End date for the results/computation required: false schema: $ref: '#/components/schemas/MerqTimestamp' secnameParam: name: secname in: path description: name of the security for which the data is requested required: true schema: type: string identifierParam: name: identifier_uuid in: path description: identifier UUID required: true schema: type: string identifierNameParam: name: identifier_name in: path description: identifier name required: true schema: type: string fsymIdParam: name: fsym_id in: path description: fsym id required: true schema: type: string indexUuidsParam: name: index_uuids in: query description: comma sep list of index_uuids schema: type: string pageParam: name: page in: query description: page number to load, defaults to 1 schema: type: integer minimum: 1 default: 1 pageSizeParam: name: page_size in: query description: size of the page to load, defaults to 1000 schema: type: integer minimum: 1 default: 1000 filterParam: name: filter in: query description: Search keyword for filtering; searches name and title for this substring required: false schema: type: string example: MQU idsParam: name: ids in: query description: Taken as a comma delimited list of ids to pull. ignored if ?names is specified. required: false schema: type: string example: abcd1234,wxyz4567 nameParam: name: name in: query description: Taken as an *Exact* name to find a resource by required: false schema: type: string example: MQUSTB20 namesParam: name: names in: query description: Taken as a comma delimited list of *Exact* names to find a list if resources by required: false schema: type: string example: MQUSTB20,MQUSTRAV namespaceParam: name: namespace in: query description: Retrieve all resources in this namespace required: false schema: type: string example: my_client_namespace fieldsParam: name: fields in: query description: only return these fields, plus id,namespace, for each of the resource definitions required: false schema: type: string example: title,description debugParam: name: debug in: query description: turns on debugging information by injecting a debug section at the top level required: false schema: type: string enum: - 'true' formatParam: name: format in: query description: choose csv (Default json) required: false schema: type: string enum: - csv uuidParam: name: uuid in: path description: uuid of the resource required: true schema: type: string