openapi: 3.2.0 info: title: Portfolio Optimizer Optimization API description: 'Moment''s Portfolio Optimizer API is a modern platform for generating fixed income portfolios. For complete documentation on the Portfolio Optimizer API and to obtain your keys head to https://withmoment.com/docs/api-documentation/api-v1/. Once you have your keys, head to the environments tab to quickly get started.' version: 0.1.0 contact: name: Moment Support email: support@withmoment.com url: https://withmoment.com/support servers: - url: https://live.moment-api.com - url: https://paper.moment-api.com security: - bearerAuth: [] tags: - name: Optimization paths: /v1/optimization/: post: tags: - Optimization summary: Submit Optimization description: 'The Submit Optimization API submits a set of accounts and their strategies to generate an optimized portfolio. The API returns an optimization ID that can be used to check the status of the optimization and retrieve the orders generated by the optimization.' operationId: postOptimization requestBody: content: application/json: schema: $ref: '#/components/schemas/OptimizationRequest' required: true responses: '200': description: Successful Response content: application/json: schema: type: object properties: optimization_id: type: string title: Optimization ID required: - optimization_id /v1/optimization/preview/: post: tags: - Optimization summary: Generate Preview description: 'The Generate Preview API submits an account and its strategy to create a preview of an optimized portfolio. This endpoint synchronously returns the generated orders for the account, utilizing cached market data and relaxing certain constraints to quickly provide a preview of the expected orders. Note that the `Trade` constraint is not enforced, when generating a preview.' operationId: postPreview requestBody: content: application/json: schema: $ref: '#/components/schemas/PreviewRequest' required: true responses: '200': description: Successful Response content: application/json: schema: type: object properties: orders: type: array items: $ref: '#/components/schemas/Order' title: Orders /v1/optimization/replacement-candidates/: post: tags: - Optimization summary: Get Replacement Candidates description: The Get Replacement Candidates API returns the replacement candidates for a specific instrument, across a set of accounts. operationId: postReplacementCandidates requestBody: content: application/json: schema: $ref: '#/components/schemas/ReplacementCandidatesRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ReplacementCandidatesResponse' /v1/optimization/{optimization_id}/: get: tags: - Optimization summary: Get Optimization Status description: 'The Get Optimization Status API returns the status for a specific optimization. The status can be one of the following: - `queued`: The optimization has been queued for processing. - `running`: The optimization is currently running. - `success`: The optimization has completed successfully. - `failed`: The optimization has failed. - `unknown`: The status of the optimization is unknown. If the specified optimization ID does not exist, you will receive a `not_found` error.' operationId: getOptimizationStatus parameters: - name: optimization_id in: path required: true schema: type: string title: Optimization ID responses: '200': description: Successful Response content: application/json: schema: type: object properties: status: $ref: '#/components/schemas/OptimizationStatus' required: - status /v1/optimization/{optimization_id}/orders/: get: tags: - Optimization summary: Get Optimization Orders description: 'The Get Optimization Orders API returns the orders for a specific optimization. If the specified optimization ID does not exist, you will receive a `not_found` error.' operationId: getOptimizationsOrders parameters: - name: optimization_id in: path required: true schema: type: string title: Optimization ID responses: '200': description: Successful Response content: application/json: schema: type: object properties: orders: type: array items: $ref: '#/components/schemas/Order' title: Orders required: - orders components: schemas: StrategyUnion: description: 'Discriminator union of all strategy variants. The `strategy_type` field on each variant is the discriminator; consumers receive a typed variant and do not need to duck-type extra fields.' discriminator: propertyName: strategy_type mapping: rules_based: '#/components/schemas/Strategy' security_list: '#/components/schemas/SecurityListStrategy' oneOf: - $ref: '#/components/schemas/Strategy' - $ref: '#/components/schemas/SecurityListStrategy' FixedCostPerTrade: description: An optional fixed cost per trade to apply to the optimization. type: number minimum: 0 title: Fixed Cost Per Trade SecurityListStrategy: description: Strategy for security-list (equity) optimization. Carries the same constraint surface as a rules-based strategy plus an explicit list of target securities, an allocation type, and an optional notional basis. type: object properties: allow_odd_lots: description: If false, prevents creating positions below the asset's minimum trading denomination (issue minimum). Defaults to true for backward compatibility. type: boolean default: true title: Allow Odd Lots cash_buffer: description: The cash buffer to maintain in the account. type: number default: 0 title: Cash Buffer constraints: description: The constraints to apply to the strategy. Defaults to an empty list when omitted — security-list / equity strategies carry constraints only via per-account `customizations`, so clients can leave this off the wire payload. type: array items: $ref: '#/components/schemas/schemas-Constraint' default: [] title: Constraints scope_relative_weights: description: If true, a min or max weight bound on a scoped allocation or diversification constraint is a share of the scope's post-trade market value instead of the account's. Defaults to false. type: boolean default: false title: Scope Relative Weights schema_version: type: integer enum: - 1 title: Schema Version strategy_type: description: Discriminator literal identifying this as a security-list (equity) strategy. type: string enum: - security_list title: Strategy Type securities: description: The list of target securities for the strategy. type: array items: $ref: '#/components/schemas/SecurityListItem' title: Securities allocation_type: description: 'How the security list is interpreted: `static` allocates exactly the listed shares/weights; `dynamic` lets the optimizer adjust within constraint bounds.' type: string enum: - static - dynamic default: static title: Allocation Type notional_basis: description: Optional notional dollar basis the security list is sized against. type: - number - 'null' title: Notional Basis required: - schema_version - strategy_type title: SecurityListStrategy ReplacementCandidate: type: object properties: allocations: description: The allocations of the replacement candidate mapping from account ID to quantity. type: object additionalProperties: $ref: '#/components/schemas/Decimal' instrument_id: $ref: '#/components/schemas/InstrumentID' limit_price: $ref: '#/components/schemas/Decimal' limit_ytw: $ref: '#/components/schemas/Decimal' objective: description: The aggregate optimization objective value for this replacement candidate across all allocated accounts. $ref: '#/components/schemas/Decimal' title: Objective objective_components: description: Enriched objective function decomposition with full term definitions, computed values, and individual leaf values for each component. type: array items: $ref: '#/components/schemas/ObjectiveComponentDetail' title: Objective Components quantity: $ref: '#/components/schemas/Decimal' tax_effective_limit_ytw: description: Tax-effective (after-tax) limit YTW for the candidate, weighted by allocation quantity across the allocated accounts. Nil when the computation yields no finite value. $ref: '#/components/schemas/Decimal' post_tax_limit_ytw: description: Post-tax limit YTW for the candidate. $ref: '#/components/schemas/Decimal' required: - instrument_id - quantity - limit_price - allocations title: ReplacementCandidate LadderPolicyConstraint: type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: $ref: '#/components/schemas/ConstraintPriority' end_period: description: The ending period of the ladder. Required unless `num_periods` is provided. type: integer example: 1 title: End Period grace_period_months: description: The length of the grace period in months. The grace period is the time period after the assignment date where a dynamic ladder policy constraint are not yet being adjusted. type: integer default: 1 title: Grace Period Months market_value_tolerance: description: The maximum market value deviation allowed for each bucket in the ladder, which can be specified instead of weight_tolerance. type: number format: double title: Market Value Tolerance maturity_option: description: Which date a ladder bucket measures against. Nullable because persisted payloads carry an explicit null, which readers already treat as the default. default: maturity_date x-omitempty: true allOf: - $ref: '#/components/schemas/MaturityOption' name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name num_periods: description: Alternative to `end_period`; sets `end_period` to `start_period + num_periods`. May be sent with `end_period` only when they agree (`end_period == start_period + num_periods`); conflicting values are rejected. type: integer example: 6 title: Num Periods period_length: description: The length of one ladder period in months. type: integer example: 12 title: Period Length scope: $ref: '#/components/schemas/FilterDictionary' start_period: description: The starting period of the ladder. type: integer example: 0 default: 0 title: Start Period type: type: string enum: - ladder_policy title: Type use_call_adjusted_maturity: description: The call adjusted maturity date is the terminal date of the bond implied by its yield to worst. If set to true then the ladder policy constraint will use the call adjusted maturity date instead of the maturity date. type: boolean default: false title: Use Call Adjusted Maturity use_assignment_date: description: When true, the assignment date anchors the ladder policy time-line; when false, the time-to-maturity mode is used (rolling buckets relative to today). Defaults to true. type: boolean default: true title: Use Assignment Date weight_tolerance: description: The maximum weight deviation allowed for each bucket in the ladder. type: number format: double example: 0.05 title: Weight Tolerance required: - type - period_length title: LadderPolicyConstraint ReplacementCandidatesRequest: type: object properties: accounts: type: array items: $ref: '#/components/schemas/AccountOptimization' title: Accounts limit: description: The maximum number of replacement candidates to return. type: integer default: 5 title: Limit order_id: description: The ID of the order to replace. type: string title: Order ID proposed_orders: type: array items: $ref: '#/components/schemas/ProposedOrder' title: Proposed Orders use_evals_as_orders: description: When true, use synthetic eval order book generated from price estimates instead of real market data. type: boolean default: false title: Use Evals As Orders account_constraint_relaxation: description: 'Per-constraint relaxed bounds the solver used to reach the orders being replaced, keyed by the optimization account id (`account:sleeve`) that solved under them. Candidates are evaluated against these rather than the originals — the order under replacement does not itself satisfy the original bound, so every candidate would be rejected. Keyed per account because a bound relaxed for one account does not hold for another.' type: - object - 'null' additionalProperties: $ref: '#/components/schemas/ConstraintRelaxation' valuation_config: description: 'Valuation configuration the caller resolved for the requesting org. When absent, the replacer falls back to its own org-based resolution.' allOf: - $ref: '#/components/schemas/ValuationConfig' required: - order_id - accounts - proposed_orders title: ReplacementCandidatesRequest InstrumentID: description: Instrument ISIN type: string example: US594918AD66 title: Instrument ID ReplacementCandidatesResponse: type: object properties: replacement_candidate_id: type: string title: Replacement Candidate ID candidates: type: array items: $ref: '#/components/schemas/ReplacementCandidate' title: Candidates required: - replacement_candidate_id - candidates title: ReplacementCandidatesResponse BuyUniverseConstraint: description: 'The BuyUniverseConstraint is a constraint that specifies the universe of instruments that can be bought in the account. Within the filter field, you can specify filters based on reference data fields and live fields (this includes: `order_price`, `order_ytw`, `tax_effective_limit_ytw`, `post_tax_limit_ytw`, `fixed_transaction_cost_in_yield`, and `fixed_transaction_cost_in_price`).' type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: $ref: '#/components/schemas/ConstraintPriority' filter: $ref: '#/components/schemas/FilterDictionary' name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name scope: $ref: '#/components/schemas/FilterDictionary' type: type: string enum: - buy_universe title: Type required: - type - filter title: BuyUniverseConstraint PiecewiseCondition: type: object properties: account_market_value: description: the account market value that we will use for the piecewise constraint. allOf: - $ref: '#/components/schemas/Filter' x-go-type-skip-optional-pointer: true EvaluatedOperationTerm: description: An operation term decorated with its computed value and evaluated children. type: object properties: left: $ref: '#/components/schemas/EvaluatedObjectiveTerm' operation: description: The operation to apply. $ref: '#/components/schemas/ObjectiveTermOperation' right: $ref: '#/components/schemas/EvaluatedObjectiveTerm' type: type: string enum: - operation default: operation value: description: The computed result of applying the operation. type: number format: double required: - type - operation - left - right - value title: EvaluatedOperationTerm CashflowBandConstraint: description: 'Levels the recurring cashflow targets of every account on the strategy: each live bucket of a recurring target is held within ±max_deviation_ratio of that target''s post-trade mean bucket cashflow, in raw dollars, while the objective is still maximized. Buckets with an amount override are left out of the band, as are one_time targets and targets with fewer than two remaining buckets. Assigned accounts inherit it; per-account customizations may override or remove it by id.' type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: description: Same as ConstraintPriority, but omitted defaults to 1, so the band relaxes before the cashflow floors (tier 2). allOf: - $ref: '#/components/schemas/ConstraintPriority' default: 1 max_deviation_ratio: description: Half-width of the band as a fraction of the target's mean bucket, in (0, 1]. type: number format: double maximum: 1 title: Max Deviation Ratio exclusiveMinimum: 0 name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name type: type: string enum: - cashflow_band title: Type required: - type - max_deviation_ratio title: CashflowBandConstraint TradeSizeBasis: description: The field a trade constraint's `min_size`/`max_size` bounds are evaluated on. type: string default: market_value enum: - market_value - par x-enum-varnames: - TradeSizeBasisMarketValue - TradeSizeBasisPar title: Trade Size Basis MaturityOption: description: The maturity option for the ladder policy constraint. type: string default: maturity_date enum: - maturity_date - workout_date - next_call_date title: Maturity Option OrderSizeType: description: 'The unit in which the optimizer decided an order''s size: share count (equity, ETF), par dollars (fixed income), or notional dollars (mutual funds). Mirrors the trading-system order size types.' type: string enum: - shares - par - notional x-enum-varnames: - OrderSizeTypeShares - OrderSizeTypePar - OrderSizeTypeNotional title: Order Size Type BasisTotalValue: description: 'One valuation basis''s total value, split by whether uninvested cash is counted. A dollar of cash is one dollar of par, so only the securities term moves between bases.' type: object properties: with_cash: description: Total value including uninvested cash. type: number format: double title: With Cash without_cash: description: Total value of held securities alone. type: number format: double title: Without Cash required: - with_cash - without_cash title: BasisTotalValue EvaluatedFieldTerm: description: A field term decorated with its evaluated value. type: object properties: factor: description: The scaling factor applied to the field value. type: number format: double default: 1 field: description: The name of the field to reference. type: string filter: description: Optional filter applied to the field. $ref: '#/components/schemas/FilterDictionary' type: type: string enum: - field default: field value: description: The evaluated value of this field term. type: number format: double required: - type - field - value title: EvaluatedFieldTerm ConstraintPriority: description: The priority of the constraint. Constraints with lower priority values will be relaxed first. Omitted defaults to 1 (lowest priority, relaxed first); -1 marks the constraint unrelaxable (never relaxed). type: number format: double default: 1 title: ConstraintPriority SellPrecedenceConstraint: description: Enforces a trading-precedence ordering across an ordered list of security groups. Each entry in `filters` selects a group (the in-scope securities matching it); a group may only be traded once every higher-precedence (earlier) group has been fully consumed. Earlier filters are higher precedence. At least two filters are required — a single-group ordering is a no-op. type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: $ref: '#/components/schemas/ConstraintPriority' filters: description: Ordered list of group-membership filters. Index 0 is the highest-precedence group. At least two filters are required. type: array items: $ref: '#/components/schemas/FilterDictionary' minItems: 2 title: Filters name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name scope: $ref: '#/components/schemas/FilterDictionary' type: type: string enum: - sell_precedence title: Type required: - type - filters title: SellPrecedenceConstraint ObjectiveTerm: description: Top-level wrapper for an objective function term with scaling factor. type: object properties: factor: description: The scaling factor applied to the term value. type: number format: double default: 1 term: $ref: '#/components/schemas/ConcreteObjectiveTerm' required: - term title: ObjectiveTerm State: type: string enum: - AL - AK - AS - AZ - AR - CA - CO - CT - DC - DE - FL - GA - GU - HI - ID - IL - IN - IA - KS - KY - LA - ME - MD - MA - MI - MN - MS - MO - MP - MT - NE - NV - NH - NJ - NM - NY - NC - ND - OH - OK - OR - PA - PR - RI - SC - SD - TN - TX - UT - VI - VT - VA - WA - WV - WI - WY x-enum-varnames: - ALABAMA - ALASKA - AMERICAN_SAMOA - ARIZONA - ARKANSAS - CALIFORNIA - COLORADO - CONNECTICUT - WASHINGTON_DC - DELAWARE - FLORIDA - GEORGIA - GUAM - HAWAII - IDAHO - ILLINOIS - INDIANA - IOWA - KANSAS - KENTUCKY - LOUISIANA - MAINE - MARYLAND - MASSACHUSETTS - MICHIGAN - MINNESOTA - MISSISSIPPI - MISSOURI - NORTHERN_MARIANA_ISLANDS - MONTANA - NEBRASKA - NEVADA - NEW_HAMPSHIRE - NEW_JERSEY - NEW_MEXICO - NEW_YORK - NORTH_CAROLINA - NORTH_DAKOTA - OHIO - OKLAHOMA - OREGON - PENNSYLVANIA - PUERTO_RICO - RHODE_ISLAND - SOUTH_CAROLINA - SOUTH_DAKOTA - TENNESSEE - TEXAS - UTAH - VIRGIN_ISLANDS - VERMONT - VIRGINIA - WASHINGTON - WEST_VIRGINIA - WISCONSIN - WYOMING title: State OptionalOptimizerParams: description: All-nullable variant of OptimizerParams used as request input — every field is omittable so callers can override only what they care about. The runtime merges the supplied values over the deployment defaults to produce the inner OptimizerParams. type: object properties: aggregate_account_orders_at_avg_price: type: - boolean - 'null' average_value_constraint_target_diff_penalty_per_violation_distance: type: - number - 'null' average_value_constraint_violation_amount_penalty_ratio: type: - number - 'null' average_value_constraint_violation_indicator_penalty_ratio: type: - number - 'null' debug: type: - boolean - 'null' diversification_constraint_buffer: type: - number - 'null' diversification_constraint_penalty_per_buffer_width: type: - number - 'null' diversification_constraint_violation_amount_penalty_ratio: type: - number - 'null' diversification_constraint_violation_indicator_penalty_ratio: type: - number - 'null' enable_rebalancing: type: - boolean - 'null' enable_uninvested_cash_constraint: type: - boolean - 'null' heuristics_to_skip: type: array items: type: string default: [] x-go-type-skip-optional-pointer: true include_direct_priced_instruments: type: - boolean - 'null' limit_one_quote_per_isin: description: When true, the FI optimizer may trade at most one quote source per ISIN for each account. Per-lot sells split from the selected parent bid may trade together. type: - boolean - 'null' minimize_deployed_cash_coefficient: type: - number - 'null' maximum: 0 normalize_objective: allOf: - $ref: '#/components/schemas/NormalizeObjectiveParams' preview_solver_ratio_gap: type: - number - 'null' relaxation_objective_power: type: - integer - 'null' minimum: 1 maximum: 2 solver_default_timeout: type: - integer - 'null' solver_preview_timeout: type: - integer - 'null' solver_relaxation_timeout: type: - integer - 'null' solver_ratio_gap: type: - number - 'null' solver_threads: type: - integer - 'null' use_evals_as_orders: type: - boolean - 'null' use_order_book_for_bid_quotes: type: - boolean - 'null' title: OptionalOptimizerParams NormalizeObjectiveParams: description: Parameters controlling per-objective-term percentile normalization. The optimizer rescales each term's pre-normalization values into the [min_percentile, max_percentile] band of the empirical distribution and then offsets the result, so terms with very different magnitudes can be combined linearly. type: object required: - max_percentile - min_percentile - offset properties: max_percentile: type: number minimum: 0 maximum: 1 default: 0.95 title: Max Percentile x-go-type-skip-optional-pointer: true min_percentile: type: number minimum: 0 maximum: 1 default: 0.05 title: Min Percentile x-go-type-skip-optional-pointer: true offset: type: number default: 0.1 title: Offset x-go-type-skip-optional-pointer: true title: NormalizeObjectiveParams AccountTotalValue: description: 'An account''s total value on each of the three valuation bases. Every basis is required: a `target` flavor divides a numerator valued on its own basis by a total on the same basis.' type: object properties: clean: $ref: '#/components/schemas/BasisTotalValue' dirty: $ref: '#/components/schemas/BasisTotalValue' par: $ref: '#/components/schemas/BasisTotalValue' required: - clean - dirty - par title: AccountTotalValue WashSaleRestriction: type: object description: 'A forward-looking wash-sale trading block on the account, forwarded verbatim from the accounts service (populated only when the org has wash-sale prevention enabled). Suboptimal expands it into Gurobi constraints at solve time: BUY_BLOCK pins the instrument''s buy variable to 0; SELL_BLOCK pins the sell variable of each held lot older than trigger_trade_date that would realize a loss. Instrument-level as delivered; the lot-level expansion (which older lots, at a loss) is computed by suboptimal from lot basis / date / price.' properties: instrument_id: $ref: '#/components/schemas/InstrumentID' restriction_type: description: BUY_BLOCK or SELL_BLOCK. type: string enum: - BUY_BLOCK - SELL_BLOCK title: Restriction Type trigger_trade_date: description: 'The trade that created the block, as a YYYYMMDD integer (matching Holding.basis_date). For SELL_BLOCK, only lots older than this are covered. Accounts only forwards active, non-expired, enforced restrictions, so no expiration is carried — every entry is live.' type: integer title: Trigger Trade Date required: - instrument_id - restriction_type - trigger_trade_date title: WashSaleRestriction Override: description: 'Discriminator union of all account-optimization override variants. An override rewrites a declarative input of the optimization (the tracking-error benchmark, the buyable universe, the risk model) before the solver model is built — distinct from a Constraint, which restricts the already-built model. The `type` field on each variant is the discriminator. System-derived overrides (e.g. treasury risk proxies) are applied server-side and are not part of this wire union.' discriminator: propertyName: type mapping: security_replacement: '#/components/schemas/SecurityReplacementOverride' pro_rata: '#/components/schemas/ProRataOverride' oneOf: - $ref: '#/components/schemas/SecurityReplacementOverride' - $ref: '#/components/schemas/ProRataOverride' AllowSellUniverseConstraintViolations: description: A boolean flag to indicate if sells are allowed in the optimization. This will enable selling of securities that invalidate any `Universe` constraints. type: boolean default: false title: Allow Sell Universe Constraint Violations Piece: type: object properties: condition: description: the filter that we will use for the piecewise constraint. allOf: - $ref: '#/components/schemas/PiecewiseCondition' x-go-type-skip-optional-pointer: true constraints: description: the constraints that we will use for the piecewise constraint. type: array items: $ref: '#/components/schemas/ConcreteConstraint' default: [] x-go-type-skip-optional-pointer: true NullDecimal: type: - number - 'null' format: double title: NullDecimal x-go-type: decimal.NullDecimal x-go-type-import: path: github.com/shopspring/decimal name: decimal AverageValueConstraint: type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: $ref: '#/components/schemas/ConstraintPriority' field: description: The field to apply the average value constraint to. type: string title: Field max_average_value: description: The maximum average value for the field. anyOf: - type: number - type: string title: Max Average Value min_average_value: description: The minimum average value for the field. anyOf: - type: number - type: string title: Min Average Value name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name scope: $ref: '#/components/schemas/FilterDictionary' target_average_value: description: The target average value for the field. anyOf: - type: number - type: string title: Target Average Value type: type: string enum: - average_value title: Type required: - type - field title: AverageValueConstraint PreviewRequest: type: object properties: account: $ref: '#/components/schemas/AccountOptimization' optimizer_params: $ref: '#/components/schemas/OptionalOptimizerParams' fixed_cost_per_trade: $ref: '#/components/schemas/FixedCostPerTrade' allow_sell_universe_constraint_violations: description: When true, the optimizer is allowed to keep existing holdings that violate sell-universe constraints (no forced sells purely to clear universe violations). type: boolean default: false title: Allow Sell Universe Constraint Violations x-go-type-skip-optional-pointer: true organization_id: description: Organization identifier, taken from the authenticated `Moment-Organization` request header. A value supplied in the request body is ignored. type: - string - 'null' title: Organization ID parent_organization_id: description: Parent organization identifier, taken from the authenticated `Moment-Parent-Organization` request header. A value supplied in the request body is ignored. type: - string - 'null' title: Parent Organization ID required: - account title: PreviewRequest ProRataOverride: description: 'Removes one or more equity strategy securities and redistributes their combined weight across the remaining ones in proportion to their existing weights; the sources leave the buyable universe. A SecurityReplacementOverride targeting CSH_USD parks the freed weight in cash instead. `asset_subtypes` and `includes_cash` narrow which remaining securities receive a share; an ineligible one keeps its own weight. ' type: object properties: id: description: 'Stable identifier preserved across edits and ignored by the optimizer. propman uses `account-security-replacement-pro-rata:` for account-derived overrides recorded on proposal snapshots; live solves rebuild them from Accounts.' type: string title: ID sources: description: Instrument IDs to remove; their combined weight is redistributed pro-rata across the remaining strategy securities. type: array items: type: string title: Sources asset_subtypes: description: Only remaining securities of these refdata `asset_subtype` values receive a share of the freed weight; omitted or empty means all of them do. Accepts Stock, DepositoryReceipt, PreferredShares, Units, ExchangeTradedFund, ExchangeTradedCommodity and Fund. The account fails if nothing matches. type: array items: type: string title: Asset Subtypes x-go-type-skip-optional-pointer: true includes_cash: description: Whether the cash position (CSH_USD) receives a share of the freed weight. Defaults to true, the behavior before this field existed. type: boolean default: true title: Includes Cash type: type: string enum: - pro_rata title: Type required: - id - type - sources title: ProRataOverride AccountOptimization: type: object properties: account_id: type: string title: Account ID allow_rebalancing: $ref: '#/components/schemas/AllowRebalancing' x-go-type-skip-optional-pointer: true allow_sell_universe_constraint_violations: $ref: '#/components/schemas/AllowSellUniverseConstraintViolations' x-go-type-skip-optional-pointer: true assignment_date: description: 'The date on which the strategy was first deployed to the account. For ladder policy constraints, this decides the starting date of the first bucket in the ladder.' type: string format: date title: Assignment Date blocking_group: description: Array of blocking group identifiers. type: array items: type: string default: [] title: Blocking Group x-go-type-skip-optional-pointer: true buy_objective_terms: description: The objective terms scoring every trade leg, buy and sell. type: array items: $ref: '#/components/schemas/ObjectiveTerm' default: [] x-go-type-skip-optional-pointer: true cash: description: 'Uninvested USD cash in the account. Shorthand for a USD holding of the same quantity: the optimizer folds this amount into `holdings` as a USD position before solving. Mutually exclusive with an explicit cash holding — requests that set `cash` and also include a cash position in `holdings` are rejected.' allOf: - $ref: '#/components/schemas/Decimal' title: Cash cash_raise_request: $ref: '#/components/schemas/CashRaiseRequest' cashflow_targets: description: The cashflow targets for the account. type: array items: $ref: '#/components/schemas/CashflowTarget' default: [] title: Cashflow Targets x-go-type-skip-optional-pointer: true cashflow_target_priority: description: Priority of the account's cashflow target floors. Omitted defaults to 2. allOf: - $ref: '#/components/schemas/ConstraintPriority' default: 2 custodian_account_id: description: 'The custodian-tracked account number (e.g. the Fidelity account number). Used to match risk controls whose entity_ids are keyed by custodian account id rather than the Moment account id.' type: string title: Custodian Account ID customizations: type: object additionalProperties: $ref: '#/components/schemas/schemas-Constraint' x-go-type-skip-optional-pointer: true desired_market_value: description: The sleeve target market value (target sleeve MV scaled by the account total MV). Null when DoD sleeve cash is enabled, in which case the consumer falls back to actual holdings + cash balance. allOf: - $ref: '#/components/schemas/NullDecimal' title: Desired Market Value x-go-type-skip-optional-pointer: true federal_tax_rate: description: The federal tax rate for the account. allOf: - $ref: '#/components/schemas/TaxRate' title: Federal Tax Rate fixed_cost_per_allocation: description: An optional fixed cost per allocation to apply to the optimization. type: number minimum: 0 example: 0 default: 0 title: Fixed Cost Per Allocation holdings: description: The holdings in the account. type: array items: $ref: '#/components/schemas/Holding' title: Holdings is_eligible_to_participate_in_block_trades: description: Whether the account is eligible to participate in block trades. type: boolean default: true title: Is Eligible To Participate In Block Trades x-go-type-skip-optional-pointer: true x-omitempty: false local_tax_rate: description: The local tax rate for the account. allOf: - $ref: '#/components/schemas/TaxRate' title: Local Tax Rate lot_targeting_asset_classes: description: Asset classes the account's custodian supports tax-lot targeting for. Absent means unknown, and every sell is lot-tagged as before; an empty list means none are supported. type: array items: $ref: '#/components/schemas/LotTargetingAssetClass' title: Lot Targeting Asset Classes max_rebalance_buys: description: The max number of buys that can occur in a rebalance. type: integer minimum: 0 title: Max Rebalance Buys max_rebalance_market_value_pct_buys: description: The max percentage of the portfolio market value that can be repurchased in a rebalance, as a decimal fraction in [0,1]. type: number minimum: 0 maximum: 1 title: Max Rebalance Market Value Percent Buys max_rebalance_market_value_pct_sells: description: The max share of the portfolio's holdings plus cash that can be sold in a rebalance, as a decimal fraction in [0,1]. type: number minimum: 0 maximum: 1 title: Max Rebalance Market Value Percent Sells max_rebalance_sells: description: The max number of sells that can occur in a rebalance. type: integer minimum: 0 title: Max Rebalance Sells minimum_order_increment: description: 'Account-level minimum trade quantization in absolute units (face for FI, shares for equity). Combined with each instrument''s own min_increment via LCM, so the effective per-trade increment is LCM(instrument_min_increment, minimum_order_increment).' type: - integer - 'null' minimum: 1 title: Minimum Order Increment objective_strategy: description: The objective strategy for the optimization. allOf: - $ref: '#/components/schemas/ObjectiveStrategy' x-go-type-skip-optional-pointer: true orders: description: Orders from a prior proposal to preserve. Orders with lock=true will be passed through unchanged; the optimizer adjusts holdings/cash accordingly. type: array items: $ref: '#/components/schemas/Order' default: [] title: Orders x-go-type-skip-optional-pointer: true overrides: description: 'Declarative overrides applied to the account optimization before the solver model is built (e.g. security replacements that rewrite the tracking-error benchmark and the buyable universe). Distinct from `customizations`, which are solver constraints on the built model. ' type: array items: $ref: '#/components/schemas/Override' default: [] title: Overrides x-go-type-skip-optional-pointer: true proposal_action_targets: description: Per-lot or per-instrument LP variable targets derived from advisor proposal actions on this sleeve. Propman computes the target quantity per action; suboptimal fixes the corresponding LP variable via an equality constraint. type: array items: $ref: '#/components/schemas/ProposalActionTarget' default: [] title: Proposal Action Targets x-go-type-skip-optional-pointer: true wash_sale_restrictions: description: Per-account wash-sale restrictions forwarded from the accounts service. Suboptimal expands each into buy/sell LP constraints at solve time (instrument buy-block; per-lot sell-block for older-than-trigger loss lots). Empty unless the org has wash-sale prevention enabled. type: array items: $ref: '#/components/schemas/WashSaleRestriction' default: [] title: Wash Sale Restrictions x-go-type-skip-optional-pointer: true short_term_realized_gain_loss: description: Net short-term realized capital gain/loss YTD in dollars (settled + intraday). The optimizer derives remaining short-term budget from this and short_term_tax_budget. type: number title: Short Term Realized Gain Loss long_term_realized_gain_loss: description: Net long-term realized capital gain/loss YTD in dollars (settled + intraday). The optimizer derives remaining long-term budget from this and long_term_tax_budget. type: number title: Long Term Realized Gain Loss short_term_tax_budget: description: Advisor-set short-term tax budget in dollars for realized capital gains this year. type: number title: Short Term Tax Budget long_term_tax_budget: description: Advisor-set long-term tax budget in dollars for realized capital gains this year. type: number title: Long Term Tax Budget estimated_tax_bill_budget: description: Advisor-set estimated tax bill budget in dollars (cap on estimated taxes paid this year, accounting for tax rates and short-term losses offsetting long-term gains). type: number title: Estimated Tax Bill Budget total_gains_tax_budget: description: Advisor-set total gain/loss budget in dollars for realized capital gains this year. Independent of the short-term and long-term tax budgets (not their sum) — a single cap on total realized gains. type: number title: Total Gains Tax Budget tax_sensitivity: description: Advisor-set tax sensitivity, an integer from 0 (ignore taxes, minimize tracking error) to 100 (fully prioritize taxes). Scales how heavily the optimizer weights tax cost against tracking error. type: integer minimum: 0 maximum: 100 title: Tax Sensitivity short_term_tax_rate: description: Combined effective short-term tax rate (federal + state + local) as a decimal fraction. Used to estimate the tax bill on short-term realized gains. type: number minimum: 0 maximum: 1 title: Short Term Tax Rate long_term_tax_rate: description: Combined effective long-term tax rate (federal + state + local) as a decimal fraction. Used to estimate the tax bill on long-term realized gains. type: number minimum: 0 maximum: 1 title: Long Term Tax Rate tax_budget_weight: description: This account entry's share of the parent account's tax budget, in [0,1]. Sleeves of one account are optimized as independent entries, so each gets a pro-rata slice (by market value) of the account-level tax headroom; the optimizer scales every derived tax-budget cap (short/long-term and estimated-tax-bill) by this weight. Defaults to 1.0 (the whole budget) for single-entry accounts and callers that don't split. type: number minimum: 0 maximum: 1 default: 1 title: Tax Budget Weight risk_group_id: description: The account's risk group, selecting its venue connectivity. Optional — omit, null, or empty to fall back to the organization's default risk group. type: string title: Risk Group Id x-go-type-skip-optional-pointer: true state: description: 'The 2-letter US state code for the account holder. Optional — when null/absent, state-based tax math (cross-deductible-state lookups, US-territory checks, state-exempt-agency checks) falls through to "no state benefit" and bonds are treated as fully taxable at the state level.' allOf: - $ref: '#/components/schemas/State' x-go-type-skip-optional-pointer: false state_tax_rate: description: The state tax rate for the account. allOf: - $ref: '#/components/schemas/TaxRate' title: State Tax Rate strategy: $ref: '#/components/schemas/StrategyUnion' tax_profile: description: Tax profile classification for the account. Defaults to us_taxable. allOf: - $ref: '#/components/schemas/TaxProfile' default: us_taxable x-go-type-skip-optional-pointer: true custom_income_tax: description: 'Custom income tax rate as a decimal between 0 and 1. Only meaningful when tax_profile is custom_taxable or uk_taxable.' allOf: - $ref: '#/components/schemas/TaxRate' title: Custom Income Tax x-go-type-skip-optional-pointer: true custom_capital_gains_tax: description: 'Custom capital gains tax rate as a decimal between 0 and 1. Only meaningful when tax_profile is custom_taxable or uk_taxable. Under uk_taxable this rate is overridden to zero for Gilts and QCBs.' allOf: - $ref: '#/components/schemas/TaxRate' title: Custom Capital Gains Tax x-go-type-skip-optional-pointer: true account_total_value: description: 'The whole account''s value on every basis, with and without cash. Read only by validate-accounts, to build a `target` flavor''s denominator: `sleeve_target_allocation` times the entry matching the flavor''s `weight_basis` and `include_cash`. All three bases are required together so a flavor never divides a numerator on one basis by a total on another.' allOf: - $ref: '#/components/schemas/AccountTotalValue' title: Account Total Value sleeve_target_allocation: description: 'This sleeve''s target share of the account, as a fraction in [0,1]. Read only by validate-accounts, to scale `account_total_value` into a `target` flavor''s denominator.' type: - number - 'null' format: double minimum: 0 maximum: 1 title: Sleeve Target Allocation required: - account_id - federal_tax_rate - state_tax_rate - local_tax_rate - holdings - strategy - assignment_date title: AccountOptimization ProposalActionTarget: type: object description: 'Target quantity for an LP variable, derived from an advisor proposal action (Lock, DNT, Liquidate, Edit). Suboptimal fixes the variable identified by `(instrument_id, moment_lot_id?)` to `quantity` via a Gurobi equality constraint at solve time. Distinct from the polymorphic strategy `Constraint` hierarchy (which carries `type` discriminator, `id`, `priority`, etc.) — these are per-optimization directives, not strategy-level rules. Sell-side targets carry `moment_lot_id`; buy-side targets omit it (buys are not lot-keyed).' properties: instrument_id: $ref: '#/components/schemas/InstrumentID' moment_lot_id: description: Sell-side identifier. Absent for buy-side targets. type: string title: Moment Lot ID quantity: $ref: '#/components/schemas/Decimal' title: Quantity required: - instrument_id - quantity title: ProposalActionTarget Decimal: type: number format: double title: Decimal x-go-type: decimal.Decimal x-go-type-import: path: github.com/shopspring/decimal name: decimal Side: type: string enum: - buy - sell title: Side ApplicableSide: description: Which side(s) of a trade a constraint or filter applies to. Distinct from `Side`, which labels real executable order direction (`buy` or `sell` only); `ApplicableSide` adds `both` for cases like a universe filter that restricts buys, sells, or both. type: string enum: - buy - sell - both x-enum-varnames: - ApplicableSideBuy - ApplicableSideSell - ApplicableSideBoth title: ApplicableSide SecurityListItem: description: A single entry in a SecurityListStrategy's securities list. type: object properties: instrument_id: type: string title: Instrument ID ticker: type: - string - 'null' title: Ticker weight: type: - number - 'null' title: Weight shares: type: - number - 'null' title: Shares required: - instrument_id title: SecurityListItem ValuationConfig: description: 'How statistics are computed: the valuation basis (clean, dirty or par), the price they are computed on (eval or limit), and what portfolio weights are denominated against. Immutable after proposal creation.' type: object properties: basis: description: 'Valuation basis to build market-value weight columns and totals on. clean excludes accrued interest; dirty includes it; par values a position at its factor-adjusted (current) face — quantity × principal_factor — ignoring market price and accrued interest, so a paid-down bond values at remaining face. Instruments with no par value (equities) continue to be valued at their quoted price on every basis, including par. If absent, uses the org''s configured default, falling back to clean' type: - string - 'null' enum: - clean - dirty - par price_source: description: 'Price surface order-book quotes are valued on. `limit` values each quote at its raw quoted limit price; `eval` values quotes at the evaluated price. If absent, gets derived by proposal kind: `limit` for synthetic proposals, `eval` for real-account proposals, falling back to eval' type: - string - 'null' enum: - eval - limit weight_denominator_formulation: description: 'What portfolio-weight bounds are denominated against. `total_mv` is the account''s total market value (held securities plus cash); `invested_mv` is the post-trade market value of held securities alone, so uninvested cash does not dilute a weight. Affects only bounds expressed as weights — an explicit market-value bound is unchanged. If absent, gets derived by proposal kind: `invested_mv` for synthetic proposals, `total_mv` for real-account proposals, falling back to total_mv' type: - string - 'null' enum: - total_mv - invested_mv hardcode_cash_as_fund: description: 'TEMPORARY stopgap — expect deletion, not extension. `true` scores cash at the top rank of a rating field''s scale (0 on any other field) into `average_value` constraints and the three rating averages (`avg_sp_rating`, `avg_moodys_rating`, `avg_lowest_rating`) only, and is refused under `invested_mv`. The fixed-denominator averages still follow `weight_denominator_formulation` alone. `false` is a no-op. Cash never joins an `allocation` bucket, and this field is not in this schema''s immutable-after-creation set.' type: boolean default: false x-go-type-skip-optional-pointer: true title: ValuationConfig FilterDictionary: type: object properties: and: description: A list of filters to be applied in an AND relationship. type: array items: $ref: '#/components/schemas/FilterDictionary' default: [] title: And and_list: description: Alias for `and`. A list of filters to be applied in an AND relationship. Supplying both `and` and `and_list` is an error. type: array items: $ref: '#/components/schemas/FilterDictionary' title: And List not: description: A filter to be applied in a NOT relationship. $ref: '#/components/schemas/FilterDictionary' title: Not not_filter: description: Alias for `not`. A filter to be applied in a NOT relationship. Supplying both `not` and `not_filter` is an error. $ref: '#/components/schemas/FilterDictionary' title: Not Filter or: description: A list of filters to be applied in an OR relationship. type: array items: $ref: '#/components/schemas/FilterDictionary' default: [] title: Or or_list: description: Alias for `or`. A list of filters to be applied in an OR relationship. Supplying both `or` and `or_list` is an error. type: array items: $ref: '#/components/schemas/FilterDictionary' title: Or List additionalProperties: $ref: '#/components/schemas/Filter' title: FilterDictionary FieldTerm: description: A term that references a field value from the instrument data. type: object properties: factor: description: The scaling factor applied to the field value. type: number format: double default: 1 field: description: The name of the field to reference. type: string filter: description: Optional filter applied to the field. $ref: '#/components/schemas/FilterDictionary' type: type: string enum: - field default: field required: - type - field title: FieldTerm OrderLimitConstraint: description: 'Limits the number of unique securities traded in the account: the max_* fields cap, and the min_* fields floor, the count of distinct securities bought, sold, or traded in total. Helps control turnover and transaction costs.' type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: $ref: '#/components/schemas/ConstraintPriority' max_buy_orders: description: Maximum number of unique securities that may be bought. type: integer title: Max Buy Orders max_sell_orders: description: Maximum number of unique securities that may be sold. type: integer title: Max Sell Orders max_total_orders: description: Maximum number of unique securities that may be traded (bought or sold). type: integer title: Max Total Orders min_buy_orders: description: Minimum number of unique securities that must be bought. type: integer title: Min Buy Orders min_sell_orders: description: Minimum number of unique securities that must be sold. type: integer title: Min Sell Orders min_total_orders: description: Minimum number of unique securities that must be traded (bought or sold). type: integer title: Min Total Orders name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name scope: $ref: '#/components/schemas/FilterDictionary' type: type: string enum: - order_limit title: Type required: - type title: OrderLimitConstraint ProposedOrder: type: object properties: account_id: type: string title: Account ID instrument_id: $ref: '#/components/schemas/InstrumentID' order_id: description: The ID of the order. type: string title: Order ID price: $ref: '#/components/schemas/Decimal' quantity: $ref: '#/components/schemas/Decimal' side: $ref: '#/components/schemas/Side' required: - order_id - account_id - instrument_id - quantity - price - side title: ProposedOrder ConcreteConstraint: description: 'Leaf-only discriminator union. Each variant carries its own `id` field; no parent-level shared properties (so codegens emit a clean discriminator union, not intersection wrappers).' discriminator: propertyName: type mapping: allocation: '#/components/schemas/AllocationConstraint' universe: '#/components/schemas/UniverseConstraint' diversification: '#/components/schemas/DiversificationConstraint' average_value: '#/components/schemas/AverageValueConstraint' trade: '#/components/schemas/TradeConstraint' buy_universe: '#/components/schemas/BuyUniverseConstraint' oneOf: - $ref: '#/components/schemas/AllocationConstraint' - $ref: '#/components/schemas/UniverseConstraint' - $ref: '#/components/schemas/DiversificationConstraint' - $ref: '#/components/schemas/AverageValueConstraint' - $ref: '#/components/schemas/TradeConstraint' - $ref: '#/components/schemas/BuyUniverseConstraint' x-go-type-skip-optional-pointer: true TaxProfile: description: 'Tax profile classification for the account. `us_taxable` (default) uses the federal/state/local tax rates. `custom_taxable` uses `custom_income_tax` and `custom_capital_gains_tax` instead. `uk_taxable` also uses `custom_income_tax` and `custom_capital_gains_tax`, but forces the capital-gains rate to zero for instruments exempt from UK capital gains tax — Gilts (UK government bonds) and QCBs (Qualifying Corporate Bonds). `non_taxable` applies no tax adjustment at all and yields pre-tax numbers; it is distinct from `us_taxable` with zero rates.' type: string enum: - us_taxable - custom_taxable - uk_taxable - non_taxable title: TaxProfile x-go-type-skip-optional-pointer: true CashRaiseRequest: type: object properties: min_raise_amount: description: The minimum amount of cash to raise. $ref: '#/components/schemas/NonNegativeDecimal' raise_strategy: description: The strategy to use to raise cash. `maintain_compliance` will raise cash to maintain compliance with the existing constraints. type: string enum: - maintain_compliance required: - min_raise_amount - raise_strategy title: CashRaiseRequest OperationTerm: description: A term that applies an operation to other terms. type: object properties: left: description: The left operand. $ref: '#/components/schemas/ConcreteObjectiveTerm' operation: description: The operation to apply. $ref: '#/components/schemas/ObjectiveTermOperation' right: description: The right operand. $ref: '#/components/schemas/ConcreteObjectiveTerm' type: type: string enum: - operation default: operation required: - type - operation - left - right title: OperationTerm PositionType: description: 'Which direction a position is held in. This is the direction itself, not the sign of `quantity`: most custodians store a short negative, Fidelity stores it positive, so the sign cannot be read as a direction. `unspecified` means the custodian never stated one — held-away feeds do not — and reads as long.' type: string default: unspecified enum: - unspecified - long - short x-enum-varnames: - PositionTypeUnspecified - PositionTypeLong - PositionTypeShort title: Position Type UniverseConstraint: type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: $ref: '#/components/schemas/ConstraintPriority' filter: $ref: '#/components/schemas/FilterDictionary' force_close_violations: type: boolean default: false title: Force Close Violations name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name penalty: description: Soft-constraint penalty weight applied per unit of violation. Bounded to [0, 100]. type: number format: double minimum: 0 maximum: 100 default: 10 title: Penalty scope: $ref: '#/components/schemas/FilterDictionary' side: default: buy allOf: - $ref: '#/components/schemas/ApplicableSide' type: type: string enum: - universe title: Type required: - type - filter title: UniverseConstraint EvaluatedObjectiveTerm: description: An evaluated objective term with computed values at each node of the term tree. discriminator: propertyName: type mapping: field: '#/components/schemas/EvaluatedFieldTerm' operation: '#/components/schemas/EvaluatedOperationTerm' oneOf: - $ref: '#/components/schemas/EvaluatedFieldTerm' - $ref: '#/components/schemas/EvaluatedOperationTerm' title: EvaluatedObjectiveTerm TradeConstraint: description: 'A trade constraint that limits trade sizes by notional value, par value, or portfolio weight. Exactly one minimum must be specified: either min_size or min_weight (not both). Max fields are optional, but max_size and max_weight cannot both be specified. Mutual exclusivity is per bound — you can mix across bounds (e.g., min_size with max_weight is valid). Weight fields must be in the range 0-1 (representing 0-100% of portfolio value).' type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: $ref: '#/components/schemas/ConstraintPriority' max_size: description: The maximum size of the trade, measured in the unit given by `size_basis` (market value or par). Cannot be specified together with max_weight. type: number format: double title: Max Size max_weight: description: The maximum size of the trade as a percentage of the portfolio value (0-1). Cannot be specified together with max_size. type: number format: double maximum: 1 minimum: 0 title: Max Weight min_size: description: The minimum size of the trade, measured in the unit given by `size_basis` (market value or par). Either min_size or min_weight must be specified. Cannot be specified together with min_weight. type: number format: double title: Min Size min_weight: description: The minimum size of the trade as a percentage of the portfolio value (0-1). Either min_size or min_weight must be specified. Cannot be specified together with min_size. type: number format: double maximum: 1 minimum: 0 title: Min Weight name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name scope: $ref: '#/components/schemas/FilterDictionary' size_basis: $ref: '#/components/schemas/TradeSizeBasis' type: type: string enum: - trade title: Type required: - type title: TradeConstraint ObjectiveComponentDetail: description: An enriched objective function component with a decorated term tree containing evaluated values at each node. type: object properties: factor: description: The scaling factor applied to the term value. type: number format: double title: Factor term: description: The evaluated term tree with computed values at each node. $ref: '#/components/schemas/EvaluatedObjectiveTerm' title: Term value: description: The computed value of this component (factor * evaluated term value). $ref: '#/components/schemas/Decimal' title: Value required: - factor - term - value title: ObjectiveComponentDetail AllocationConstraint: type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: $ref: '#/components/schemas/ConstraintPriority' filter: $ref: '#/components/schemas/FilterDictionary' max_market_value: description: The maximum market value for the allocation constraint, which can be specified instead of max_weight. type: number format: double title: Max Market Value max_weight: description: The maximum weight for the allocation constraint. Bounded to [0, 1]. type: number format: double minimum: 0 maximum: 1 title: Max Weight min_market_value: description: The minimum market value for the allocation constraint, which can be specified instead of min_weight. type: number format: double title: Min Market Value min_weight: description: The minimum weight for the allocation constraint. Bounded to [0, 1]. type: number format: double minimum: 0 maximum: 1 title: Min Weight name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name rel_buffer: description: Relative buffer applied around the target. Half-open [0, 1). type: number format: double minimum: 0 default: 0.01 title: Rel Buffer exclusiveMaximum: 1 scope: $ref: '#/components/schemas/FilterDictionary' target_market_value: description: The target market value for the allocation constraint, which can be specified instead of target_weight. type: number format: double title: Target Market Value target_weight: description: The target weight for the allocation constraint. Bounded to [0, 1]. type: number format: double minimum: 0 maximum: 1 title: Target Weight type: type: string enum: - allocation title: Type required: - filter - type title: AllocationConstraint ConstraintRelaxation: description: 'Per-constraint relaxed bounds the solver actually used after relaxing infeasible constraints. Keyed by constraint id.' type: object additionalProperties: $ref: '#/components/schemas/ConstraintBounds' title: ConstraintRelaxation DiversificationConstraint: type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: $ref: '#/components/schemas/ConstraintPriority' equal_weight_tolerance: description: Keeps every held group within ±tolerance of a common size the optimizer picks, relative to the other held groups rather than a fixed bound (0.1 = each within 10%). In [0, 1). Must be the only limit on its rule; pair it with other limits through separate rules on the same field. type: number format: double minimum: 0 title: Equal Weight Tolerance exclusiveMaximum: 1 field: description: The field to apply the diversification constraint to. type: string title: field max_instruments_per_unique_value: description: The maximum number of instruments per unique value for the diversification constraint, which is optional to specify. type: integer title: Max Instruments Per Unique Value max_market_value_per_unique_value: description: The maximum market value per unique value for the diversification constraint. type: number format: double title: Max Market Value Per Unique Value max_unique_fields: description: The maximum number of unique values of this field that are allowed to exist. type: integer title: Max Unique Fields max_weight_per_unique_value: description: The maximum weight per unique value for the diversification constraint. type: number format: double title: Max Weight Per Unique Value min_instruments_per_unique_value: description: The minimum number of instruments per unique value for the diversification constraint, which is optional to specify. type: integer title: Min Instruments Per Unique Value min_market_value_per_unique_value: description: The minimum market value per unique value for the diversification constraint, which is optional to specify. type: number format: double title: Min Market Value Per Unique Value min_unique_fields: description: The minimum number of unique values of this field that are allowed to exist, which is optional to specify. type: integer title: Min Unique Fields min_weight_per_unique_value: description: The minimum weight per unique value for the diversification constraint, which is optional to specify. type: number format: double title: Min Weight Per Unique Value name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name scope: $ref: '#/components/schemas/FilterDictionary' type: type: string enum: - diversification title: Type x-moment-required-any-of: - min_market_value_per_unique_value - max_market_value_per_unique_value - min_weight_per_unique_value - max_weight_per_unique_value - min_unique_fields - max_unique_fields - min_instruments_per_unique_value - max_instruments_per_unique_value - equal_weight_tolerance required: - type - field title: DiversificationConstraint AllowRebalancing: description: A boolean flag to indicate if rebalancing is allowed in the optimization. type: boolean default: false title: Allow Rebalancing PiecewiseConstraint: type: object properties: id: description: Unique identifier for this constraint. Must match the `constraint_id` on the enclosing `ConstraintOperation`. Required. type: string title: ID constraint_priority: $ref: '#/components/schemas/ConstraintPriority' name: description: 'Optional user-supplied display label for the constraint, shown in place of the generated description. Cosmetic only: never read by the solver and never part of the constraint''s identity, so distinct constraints may share a name.' type: string maxLength: 200 title: Name pieces: description: the pieces that we will use for the piecewise constraint. type: array items: $ref: '#/components/schemas/Piece' default: [] x-go-type-skip-optional-pointer: true scope: $ref: '#/components/schemas/FilterDictionary' type: type: string enum: - piecewise title: Type required: - type title: PiecewiseConstraint Holding: type: object properties: basis_date: description: Acquisition date of the lot as a YYYYMMDD integer. type: integer title: Basis Date basis_price: description: Cost basis price of the lot. allOf: - $ref: '#/components/schemas/Decimal' title: Basis Price instrument_id: oneOf: - $ref: '#/components/schemas/Currency' - $ref: '#/components/schemas/InstrumentID' limit_price: description: The limit price of the holding, used to override market data price. allOf: - $ref: '#/components/schemas/Decimal' title: Limit Price limit_ytw: description: 'The holding''s yield to worst at its limit price — for a purchased lot, the yield locked in at purchase. Feeds avg_purchase_ytw. Does NOT override market-data YTW: avg_ytw stays on the eval yield so the two statistics remain distinct.' allOf: - $ref: '#/components/schemas/Decimal' title: Limit Yield to Worst lock: description: If true, this holding is locked and will not be sold with optimization. type: boolean title: Lock long_term: description: Whether the lot has been held for more than one year. type: boolean title: Long Term lot_id: description: Unique identifier for the lot (moment_lot_id). type: string title: Lot ID position_type: description: 'The direction this holding is held in, where it is a single lot (`lot_id` present). Read direction from here, never from the sign of `quantity`. An aggregate over lots states `unspecified`: it has no one direction, and its `quantity` is signed instead.' allOf: - $ref: '#/components/schemas/PositionType' x-go-type-skip-optional-pointer: true quantity: allOf: - $ref: '#/components/schemas/Decimal' description: 'Signed where this holding aggregates lots (`lot_id` absent), so a short reduces the instrument''s total. Where it is a single lot (`lot_id` present) this is the custodian''s stored magnitude and its sign is not a direction — read `position_type` instead.' title: Quantity sell: description: If true, this holding should be sold during optimization. type: boolean title: Sell wash_sale: description: Whether the lot is subject to wash sale rules. type: boolean title: Wash Sale required: - instrument_id - quantity title: Holding OptimizationSource: description: Origin tag for an optimization request, used for audit and downstream filtering. type: string enum: - proposal_builder - proposal_builder_agent - ai_chat - ai_chat_agent - model_builder - optimization_api - optimization_backtest - quant_sampling_dag title: OptimizationSource Currency: type: string enum: - USD - EUR - GBP - CAD - CHF - AUD title: Currency OptimizationStatus: description: Lifecycle state of a single optimization run. type: string enum: - queued - running - success - failed - unknown title: OptimizationStatus TaxRate: description: A tax rate as a decimal fraction — 0.35 means 35%, bounded to [0,1]. type: number format: double minimum: 0 maximum: 1 title: TaxRate x-go-type: decimal.Decimal x-go-type-import: path: github.com/shopspring/decimal name: decimal OptimizationRequest: type: object properties: accounts: type: array items: $ref: '#/components/schemas/AccountOptimization' title: Accounts allow_sell_universe_constraint_violations: description: When true, the optimizer is allowed to keep existing holdings that violate sell-universe constraints (no forced sells purely to clear universe violations). Mirrored onto every account in the request. type: boolean default: false title: Allow Sell Universe Constraint Violations x-go-type-skip-optional-pointer: true batch_id: description: An optional batch ID to group optimizations together. This can be used to easily identify optimizations that were submitted together. Must contain only alphanumeric characters, hyphens, and underscores. type: - string - 'null' pattern: ^[A-Za-z0-9_-]+$ fixed_cost_per_trade: $ref: '#/components/schemas/FixedCostPerTrade' limit_price_buffer: description: An optional limit price buffer to apply to the optimization. This is a percentage value that will be added to the limit price of all the orders. $ref: '#/components/schemas/NonNegativeDecimal' title: Limit Price Buffer optimization_source: description: Origin tag for the request, recorded for audit and used by downstream filtering. Taken from the `Moment-Optimization-Source` request header, falling back to a per-route default when that header is absent or unrecognized; a value supplied in the request body is ignored. allOf: - $ref: '#/components/schemas/OptimizationSource' optimizer_params: $ref: '#/components/schemas/OptionalOptimizerParams' organization_id: description: Organization identifier, taken from the authenticated `Moment-Organization` request header. A value supplied in the request body is ignored; responses that serve a stored request payload back report the header-derived value. type: - string - 'null' title: Organization ID parent_organization_id: description: Parent organization identifier, taken from the authenticated `Moment-Parent-Organization` request header. A value supplied in the request body is ignored; responses that serve a stored request payload back report the header-derived value. type: - string - 'null' title: Parent Organization ID timestamp: description: An optional historical timestamp at which to run the optimization. The timestamp's date must be between 2024-05-01 and the current date, and the timestamp's time must be between 09:35 AM and 4:00 PM Eastern Time. type: - string - 'null' format: date-time title: Timestamp valuation_config: description: 'Valuation configuration the caller resolved for the requesting org, typically a proposal''s. If absent, the optimizer resolves the org''s configuration itself.' allOf: - $ref: '#/components/schemas/ValuationConfig' required: - accounts - optimizer_params title: OptimizationRequest schemas-Constraint: description: 'Discriminator union of all constraint variants. The `id` field on each variant is the shared identifier; consumers extract it from the resolved variant. (Removing the redundant parent-level `id` property lets the OpenAPI codegens emit a clean discriminator union instead of intersection wrappers.)' discriminator: propertyName: type mapping: universe: '#/components/schemas/UniverseConstraint' allocation: '#/components/schemas/AllocationConstraint' diversification: '#/components/schemas/DiversificationConstraint' average_value: '#/components/schemas/AverageValueConstraint' ladder_policy: '#/components/schemas/LadderPolicyConstraint' trade: '#/components/schemas/TradeConstraint' buy_universe: '#/components/schemas/BuyUniverseConstraint' piecewise: '#/components/schemas/PiecewiseConstraint' sell_precedence: '#/components/schemas/SellPrecedenceConstraint' order_limit: '#/components/schemas/OrderLimitConstraint' cashflow_band: '#/components/schemas/CashflowBandConstraint' oneOf: - $ref: '#/components/schemas/UniverseConstraint' - $ref: '#/components/schemas/AllocationConstraint' - $ref: '#/components/schemas/DiversificationConstraint' - $ref: '#/components/schemas/AverageValueConstraint' - $ref: '#/components/schemas/LadderPolicyConstraint' - $ref: '#/components/schemas/TradeConstraint' - $ref: '#/components/schemas/BuyUniverseConstraint' - $ref: '#/components/schemas/PiecewiseConstraint' - $ref: '#/components/schemas/SellPrecedenceConstraint' - $ref: '#/components/schemas/OrderLimitConstraint' - $ref: '#/components/schemas/CashflowBandConstraint' Strategy: description: Rules-based (fixed-income) strategy. Used when an account is optimized via constraint rules rather than an explicit security list. type: object properties: allow_odd_lots: description: If false, prevents creating positions below the asset's minimum trading denomination (issue minimum). Defaults to true for backward compatibility. type: boolean default: true title: Allow Odd Lots cash_buffer: description: The cash buffer to maintain in the account. type: number default: 0 title: Cash Buffer constraints: description: The constraints to apply to the strategy. Defaults to an empty list when omitted so security-list / equity strategies (which carry constraints only via customizations) can leave the field off the wire payload. type: array items: $ref: '#/components/schemas/schemas-Constraint' default: [] title: Constraints minimum_order_increment: description: The minimum order-size increment for trades in this strategy (face value). Takes precedence over the account-level value; a sleeve-level value takes precedence over this. type: - integer - 'null' minimum: 1 title: Minimum Order Increment scope_relative_weights: description: If true, a min or max weight bound on a scoped allocation or diversification constraint is a share of the scope's post-trade market value instead of the account's. Defaults to false. type: boolean default: false title: Scope Relative Weights schema_version: type: integer enum: - 1 title: Schema Version strategy_type: description: Discriminator literal identifying this as a rules-based (fixed-income) strategy. type: string enum: - rules_based default: rules_based title: Strategy Type x-go-type-skip-optional-pointer: true required: - schema_version title: Strategy ObjectiveTermOperation: description: The operation to apply between objective terms. type: string enum: - add - subtract - multiply - divide - max - min title: ObjectiveTermOperation Filter: type: object properties: equal_to: description: The value to be equal to. anyOf: - type: string - type: number - type: boolean title: Equal To greater_than: description: The value to be greater than. anyOf: - type: string - type: number - type: boolean title: Greater Than greater_than_or_equal_to: description: The value to be greater than or equal to. anyOf: - type: string - type: number - type: boolean title: Greater Than Or Equal To in: description: The value to be in the list. anyOf: - items: anyOf: - type: string - type: number - type: boolean type: array title: In List in_filter_list: description: The value to be in the filter list. type: string title: In Filter List in_list: description: Alias for `in`. The value to be in the list. Supplying both `in` and `in_list` is an error. anyOf: - items: anyOf: - type: string - type: number - type: boolean type: array title: In List includes: description: The value to include. type: string title: Includes superset: description: Match a string-list column containing every element of this list. Elements match exactly and case-sensitively; leading and trailing whitespace is ignored. Null lists do not match. type: array items: type: string minItems: 1 example: - NY - NJ title: Superset subset: description: Match a string-list column whose every element is in this list. Elements match exactly and case-sensitively; leading and trailing whitespace is ignored. Empty lists match; null lists do not. type: array items: type: string minItems: 1 example: - NY - NJ title: Subset not_superset: description: 'Match a string-list column missing at least one element of this list. The negation of `superset`: null lists match.' type: array items: type: string minItems: 1 example: - NY - NJ title: Not Superset not_subset: description: 'Match a string-list column with at least one element outside this list. The negation of `subset`: null lists match; empty lists do not.' type: array items: type: string minItems: 1 example: - NY - NJ title: Not Subset is_null: description: Match values that are null. type: boolean title: Is Null less_than: description: The value to be less than. anyOf: - type: string - type: number - type: boolean title: Less Than less_than_or_equal_to: description: The value to be less than or equal to. anyOf: - type: string - type: number - type: boolean title: Less Than Or Equal To not_equal_to: description: The value to not be equal to. anyOf: - type: string - type: number - type: boolean title: Not Equal To not_in: description: The value to not be in the list. anyOf: - items: anyOf: - type: string - type: number - type: boolean type: array title: Not In List not_in_filter_list: description: The value to be not in the filter list. type: string title: Not In Filter List not_in_list: description: Alias for `not_in`. The value to not be in the list. Supplying both `not_in` and `not_in_list` is an error. anyOf: - items: anyOf: - type: string - type: number - type: boolean type: array title: Not In List not_includes: description: The value to not include. type: string title: Not Includes not_starts_with: description: The value to not start with. type: string title: Not Starts With starts_with: description: The value to start with. type: string title: Starts With ends_with: description: The value to end with. type: string title: Ends With title: Filter ConcreteObjectiveTerm: description: A leaf or operation node in an objective term tree — either a field reference or an operation applied to other nodes. discriminator: propertyName: type mapping: field: '#/components/schemas/FieldTerm' operation: '#/components/schemas/OperationTerm' oneOf: - $ref: '#/components/schemas/FieldTerm' - $ref: '#/components/schemas/OperationTerm' title: ConcreteObjectiveTerm LotTargetingAssetClass: description: An asset class for custodian tax-lot targeting support. ETFs and ETCs count as equity. type: string enum: - equity - fixed_income - fund x-enum-varnames: - LotTargetingAssetClassEquity - LotTargetingAssetClassFixedIncome - LotTargetingAssetClassFund title: Lot Targeting Asset Class CashflowTarget: type: object properties: amount: description: The amount of cashflow to target for each bucket. Omit for no dollar floor (the maximize_cashflows input). type: number format: double minimum: 0 title: Amount call_assumption: description: The call assumption of the cashflow target. type: string enum: - maturity_date - next_call_date - workout_date title: Call Assumption end_date: description: The end date of the cashflow target. type: string format: date title: End Date frequency: description: The frequency of the cashflow target. type: string enum: - monthly - bimonthly - quarterly - semiannually - annually - one_time title: Frequency granularity: description: How long each bucket stays open, anchored on each frequency start. Omit for a bucket spanning the whole frequency period. Must not be wider than frequency; not allowed on one_time targets. type: string enum: - monthly - bimonthly - quarterly - semiannually - annually x-enum-varnames: - GranularityMonthly - GranularityBimonthly - GranularityQuarterly - GranularitySemiannually - GranularityAnnually title: Granularity overrides: description: Per-bucket amount overrides, keyed by the bucket's start date in `YYYYMMDD` format. type: object additionalProperties: type: number format: double title: Overrides x-go-type-skip-optional-pointer: true source: description: The source of the cashflow target. type: string enum: - coupon - principal - coupon_and_principal title: Source start_date: description: The start date of the cashflow target. type: string format: date title: Start Date required: - end_date - frequency - source - call_assumption title: CashflowTarget ConstraintBounds: description: 'Lower and upper bounds for a constraint. Used by the relaxation map to carry the bounds the solver actually used after relaxing infeasible constraints. `min`/`max` are numbers in the same space as the user-supplied constraint bound (MV or weight for allocation and diversification, raw field value for average-value). Either side may be omitted (null) when the solver did not relax that side.' type: object properties: min: type: number format: double max: type: number format: double title: ConstraintBounds SecurityReplacementOverride: description: 'Override that substitutes equity strategy securities 1:1 before optimization. The target replaces the source in both the tracking-error benchmark (inheriting the source''s weight) and the buyable universe; a held source remains sellable. A target of CSH_USD leaves that weight as cash. `map` is keyed by source instrument_id with target instrument_id values. ' type: object properties: id: description: 'Stable identifier preserved across edits and ignored by the optimizer. propman uses `account-security-replacement:` for account-derived overrides recorded on proposal snapshots; live solves rebuild them from Accounts.' type: string title: ID map: description: Directional 1:1 substitution map, source instrument_id -> target instrument_id. type: object additionalProperties: type: string title: Map type: type: string enum: - security_replacement title: Type required: - id - type - map title: SecurityReplacementOverride NonNegativeDecimal: description: A decimal quantity that must not be negative. type: number format: double minimum: 0 title: NonNegativeDecimal x-go-type: decimal.Decimal x-go-type-import: path: github.com/shopspring/decimal name: decimal Order: type: object properties: account_id: description: The account ID that the order belongs to. On account-based optimization this is the composite `{account_id}:{sleeve_id}`, not a bare account id. type: string title: Account ID block_id: description: A unique ID for the block trade that the order belongs to. This can be used to easily group orders that can be submitted as part of a single block trade. type: integer title: Block ID cusip: description: The CUSIP is a nine-digit numeric or nine-character alphanumeric code that identifies a North American financial security. type: string example: 594918AD6 title: CUSIP instrument_id: $ref: '#/components/schemas/InstrumentID' is_full_liquidation: description: True when this sell order takes the whole position to zero. On notional (mutual fund) orders it also means `net_money` may carry a sub-dollar remainder, so consumers must use it as given rather than rounding it to whole dollars and re-deriving the share count. Absent or false on buys, on partial sells, and from optimizers that predate the field. type: boolean title: Is Full Liquidation is_sale_violating_universe_constraint: description: A flag to indicate whether a sell order is due to a universe constraint violation. Will be left null for buy orders. type: boolean title: Is Sale Violating Universe Constraint limit_price: description: The limit price of the order. $ref: '#/components/schemas/Decimal' title: Limit Price limit_ytm: description: The limit yield to maturity of the order. $ref: '#/components/schemas/Decimal' title: Limit Yield to Maturity limit_ytw: description: The limit yield to worst of the order. $ref: '#/components/schemas/Decimal' title: Limit Yield to Worst lock: description: If true, this order was locked from a prior proposal and passed through unchanged. type: boolean title: Lock lot_id: description: Unique identifier for the lot (moment_lot_id). Present on sell orders when lot-level optimization is enabled. type: string title: Lot ID net_money: description: The net money of the order in dollars. This is caclulated as quantity * (limit_price / 100) + (quantity / par_value) * accrued_interest. $ref: '#/components/schemas/Decimal' title: Net Money objective: description: The optimization objective value returned by the optimizer for this order. $ref: '#/components/schemas/Decimal' title: Objective objective_components: description: Enriched objective function decomposition with full term definitions, computed values, and individual leaf values for each component. type: array items: $ref: '#/components/schemas/ObjectiveComponentDetail' title: Objective Components par_value: description: The par value of the instrument. $ref: '#/components/schemas/Decimal' title: Par Value portfolio_id: description: The portfolio the order belongs to. Household optimization only. type: string title: Portfolio ID quantity: description: The quantity of the instrument to be traded, in notional value. $ref: '#/components/schemas/Decimal' title: Quantity side: $ref: '#/components/schemas/Side' size_type: description: The unit in which the optimizer decided this order's size. For notional orders (mutual funds), net_money carries the exact decided dollars and is the authoritative order size; quantity is the derived share count (net_money / NAV) and carries float-division error. For shares / par orders, quantity is authoritative. $ref: '#/components/schemas/OrderSizeType' title: Size Type sleeve_id: description: The sleeve (the account-and-portfolio cell) the order belongs to. Household optimization only. type: string title: Sleeve ID tax_effective_limit_ytw: description: The tax effective limit yield to worst of the order. Calculated as limit_ytw * (1 - tax_rate) / (1 - federal_tax_rate - state_tax_rate - local_tax_rate) $ref: '#/components/schemas/Decimal' title: Tax Effective Limit Yield to Worst post_tax_limit_ytw: description: The post-tax limit yield to worst of the order. $ref: '#/components/schemas/Decimal' title: Post Tax Limit Yield to Worst transaction_cost: description: The estimated transaction cost of the order. type: number title: Transaction Cost required: - block_id - side - instrument_id - quantity - limit_price - account_id - net_money title: Order ObjectiveStrategy: description: The objective strategy for the optimization. type: string enum: - revenue - minimize_deployed_cash - maximize_cashflows title: ObjectiveStrategy x-go-type-skip-optional-pointer: true securitySchemes: bearerAuth: type: http scheme: bearer x-provenance: method: searched source: https://docs.moment.com/reference harvested: '2026-10-14' tool: harvest-readme-openapi.py note: Assembled verbatim from the OpenAPI definition ReadMe embeds in each operation page of the provider's developer portal; paths and components merged by API title, nothing authored. assembled_from: - https://docs.moment.com/reference/getbackteststatus.md - https://docs.moment.com/reference/getoptimizationsorders.md - https://docs.moment.com/reference/getoptimizationstatus.md - https://docs.moment.com/reference/postbacktest.md - https://docs.moment.com/reference/postoptimization-1.md - https://docs.moment.com/reference/postpreview.md - https://docs.moment.com/reference/postreplacementcandidates.md merge: pages: 7 deduped: 209 conflicts_kept_first: 0