Security Classification
Security Classification organizes each security into a hierarchical tree of classes and subclasses with up to 4 levels. It is what defines, for example, that a stock is in "Variable Income > Stocks" and that an inflation-indexed government bond is in "Fixed Income > Inflation Indexed > Government Bond". This structure is the basis for the allocation analyses of a portfolio by asset class and for investment profiles.
Level hierarchy
Each classification belongs to a level, from CLASSIFICATION_L0 (the broadest, such as Fixed Income, Variable Income or Multimarket) to CLASSIFICATION_L3 (the most detailed). Every classification below L0 points to its parent classification through parentId; at L0, parentId is null. A security is always placed in a structure with at least 2 and at most 4 levels, which means that to reclassify a security you need to provide (at least) its new CLASSIFICATION_L0 and CLASSIFICATION_L1.
In a portfolio's views, the hierarchy is cumulative: a security classified under "Fixed Income > Inflation Indexed" also counts toward the "Fixed Income" total.
Official classification and reclassification
By default, Gorila classifies securities using a proprietary methodology that seeks to adhere to market conventions and standards and that also uses official sources, such as B3 and Anbima. This proprietary classification does not always reflect the logic each institution uses to evaluate its portfolios. A fund classified by Anbima as Multimarket, but tied to the CDI, may be treated as Fixed Income by an asset manager, and this changes how the portfolio's target allocation compliance with the investor's profile is read.
For these cases, your organization can create custom classifications and reclassify securities:
- Custom classes can be created at any level, including as subclasses of Gorila's official classes. To build an entirely custom chain, create the classes in order, from L0 to L3, using the identifier of the newly created parent class at each step.
- Reclassifying a security means pointing it to one of your organization's classifications. Each security has a single classification at a time, and the securities you do not reclassify keep following the official classification.
- Reverting to the default: when you remove a security's custom classification, it returns to Gorila's official classification.
Reclassification applies to all portfolios in your organization. In connected portfolios (shared with your organization), you see the securities under your organization's classification, while the portfolio owner keeps seeing them under Gorila's official classification, in their personal account.
Editing and deletion
Only custom classifications can be renamed or deleted; Gorila's official classifications are fixed. When you delete a custom classification, all subclasses below it are also deleted, and the securities that were in them automatically return to Gorila's official classification.
Use in queries
Classifications can also be used to filter and group the metrics of portfolios and economic groups:
- Considering only one classification: most metrics endpoints accept the
securityClassificationfilter, with the identifier of a classification. - Excluding classifications: the portfolio and economic group endpoints that accept
securityClassification, except List Position Dividend Yield, also accept theexcludeSecurityClassificationfilter, with one or more classification identifiers. The securities in these classifications are not included in the result. - Grouping by level: the per-position breakdowns accept grouping the result by classification level (
groupByequal toCLASSIFICATION_L0,CLASSIFICATION_L1,CLASSIFICATION_L2orCLASSIFICATION_L3), as in List Position Market Values.
The securityClassification and excludeSecurityClassification filters use each security's classification in your organization, including reclassifications and custom classifications, and apply to the given classification and to all subclasses below it. That is why the two can be combined: with securityClassification=FIXED_INCOME and the identifier of a Fixed Income subclass in excludeSecurityClassification, the result includes all of Fixed Income except that subclass.
To provide more than one identifier in excludeSecurityClassification, repeat the parameter or separate the values with commas. For example, to track a portfolio's Net Asset Value (NAV) without its Variable Income and Multimarket securities:
GET /portfolios/{portfolioId}/nav?frequency=DAILY&excludeSecurityClassification=VARIABLE_INCOME,MULTIMARKET
An identifier that does not exist does not cause an error: it simply excludes nothing. The identifiers of the classifications, both official and your organization's, are in List Securities Classifications.
Where to access
In GorilaCORE, you can list the classifications available to your organization (with filters by level, parent classification and name), read a specific classification, and create, rename and delete custom classifications. To reclassify a security, or return it to the official classification, use the update security endpoint, providing the desired classificationId (or null).