action portfoliooptimizer_post_portfolio_construction_investable { label: "Investable Portfolio" description: "Compute an investable portfolio as close as possible, in terms of assets weights, to a desired portfolio, taking into account:\n* The desired assets weights\n* The desired assets groups weights\n* The desired maximum assets groups weights\n* The prices of the assets\n* The portfolio value\n* The requirement to purchase some assets by round lots or by odd lots\n* The possibility to purchase some assets by a fractional quantity of shares\n* The requirement to purchase a minimum number of shares, or a minimum monetary value, for some assets\n\nReferences\n* [Steiner, Andreas, Accuracy and Rounding in Portfolio Construction](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2261131)\n" provider: portfoliooptimizer method: POST path: "/portfolio/construction/investable" encoding: json input: { type: "object" required: ["assets", "assetsPrices", "portfolioValue"] properties: { assets: { type: "integer" description: "The number of assets" } assetsGroups: { type: "array" items: { type: "array" description: "assetsGroups[k] is the indexes of the assets belonging to the assets group k in the portfolio; requires either assetsGroupsWeights or maximumAssetsGroupsWeights to be present" items: { type: "integer" } } } assetsGroupsWeights: { type: "array" description: "assetsGroupsWeights[i] is the desired weight of the assets group k in the portfolio, in percentage (can be null to indicate no specific desire); requires assetsGroups to be present" items: { type: "number" } } assetsMinimumNotionalValues: { type: "array" description: "assetsMinimumNotionalValues[i] is the minimum monetary value that the position in the asset i is required to represent when the asset i is included in the portfolio" items: { type: "number" } } assetsMinimumPositions: { type: "array" description: "assetsMinimumPositions[i] is the minimum number of shares of the asset i that is required to purchase when the asset i is included in the portfolio (usual values are the same as for assetsSizeLots)" items: { type: "number" } } assetsPrices: { type: "array" description: "assetsPrices[i] is the price of the asset i" items: { type: "number" } } assetsSizeLots: { type: "array" description: "assetsSizeLots[i] is the number of shares by which it is required to purchase the asset i (usual values are 1 if the asset needs to be purchased share by share, 100 if the asset needs to be purchased by an integer multiple of 100 shares, and 1/1000000 - e.g. for Robinhood broker - if the asset can be purchased by fractional shares)" items: { type: "number" } } assetsWeights: { type: "array" description: "assetsWeights[i] is the desired weight of the asset i in the portfolio, in percentage (can be null to indicate no specific desire)" items: { type: "number" } } maximumAssetsGroupsWeights: { type: "array" description: "maximumAssetsGroupsWeights[k] is the maximum desired weight of the assets group k in the portfolio, in percentage (can be null to indicate no specific desire); requires assetsGroups to be present" items: { type: "number" } } portfolioValue: { type: "number" description: "The monetary value of the portfolio" } } } output: { type: "object" required: ["assetsPositions", "assetsWeights"] properties: { assetsPositions: { type: "array" description: "assetsPositions[i] is the number of shares of the asset i in the portfolio" items: { type: "number" } } assetsWeights: { type: "array" description: "assetsWeights[i] is the weight of the asset i in the portfolio, in percentage" items: { type: "number" } } } } }