# Portfolio

A collection of your investments, like stocks, bonds, or funds, all in one place.

# Portfolio

#### **Table of Contents**

- [Description](#bkmrk-description)
- [Examples](#bkmrk-examples)
- [Cookbook](#bkmrk-cookbook)
- [F.A.Q.](#bkmrk-api-documentation)
- [API Documentation](#bkmrk-api-documentation)

#### **Description**

##### *Financial meaning*

**Portfolio** refers to a collection of financial assets. Portfolios are held directly by investors and/or managed by financial professionals. Effective portfolio management involves diversification, asset allocation, and regular performance monitoring to optimize returns and manage risks.

##### *Platform abstraction*

**Portfolio** in Finmars platform is a container for financial assets (cash ([currency](https://docs.finmars.com/books/entities/page/currency "Currency")) &amp; [instruments](https://docs.finmars.com/books/entities/page/instrument "Instrument")) allocation.

**Portfolio also is used in:**

- [performance](https://docs.finmars.com/books/reports/chapter/performance "Performance") calculation with its [registers](https://docs.finmars.com/books/entities/chapter/register "Register") grouped in [bundles](https://docs.finmars.com/books/entities/chapter/bundle "Bundle")
- [reconciliation](https://docs.finmars.com/books/reports/chapter/reconciliation "Reconciliation") using special [portfolio type](https://docs.finmars.com/books/entities/page/portfolio-type "Portfolio Type") and [portfolio reconcile group](https://docs.finmars.com/books/entities/page/portfolio-reconcile-group "Portfolio Reconcile Group").

#### **Examples**

<table border="1" id="bkmrk-" style="border-collapse: collapse; width: 107.5%;"><colgroup><col style="width: 6.67461%;"></col><col style="width: 8.70083%;"></col><col style="width: 6.7938%;"></col><col style="width: 6.67461%;"></col><col style="width: 6.91299%;"></col><col style="width: 6.91299%;"></col><col style="width: 10.7271%;"></col><col style="width: 10.7271%;"></col><col style="width: 9.29621%;"></col><col style="width: 10.7276%;"></col><col style="width: 8.10489%;"></col><col style="width: 7.86651%;"></col></colgroup><thead><tr><td class="align-center">User code</td><td class="align-center">Portfolio Type</td><td class="align-center">Name</td><td class="align-center">Short name</td><td class="align-center">Public name</td><td class="align-center">Notes</td><td class="align-center">First Transaction Date</td><td class="align-center">First Cash Flow Date</td><td class="align-center">Accounts</td><td class="align-center">Transaction types</td><td>Responsibles</td><td>Counterparties</td></tr></thead><tbody><tr><td>obl01  
</td><td>Manual</td><td>Bonds</td><td>Bonds</td><td>Bonds</td><td>-</td><td>2022-12-01</td><td>2022-12-01</td><td>  
</td><td>  
</td><td>  
</td><td>  
</td></tr></tbody></table>

- `User code`: workspace unique identifier of the portfolio with source prefix as it's multi-source entity
- `Portfolio Type`: configuration-defined criterion for reconciliation
- `Name`: full name
- `Short name`: short name, showed in other relations
- `Public name`: public view name for users without access
- `Notes`: custom description for portfolio
- `First Transaction Date`: date of the first transaction in the portfolio (changes by the logic described below)
- `First Cash Flow Date`: date of the first transaction in the portfolio for base transaction class == <span class="code" spellcheck="false">Cash-Inflow</span> or <span class="code" spellcheck="false">Cash-Outflow</span> (changes by the logic described below)
- `Accounts`: (not strict, informative) selected accounts that can be used for this portfolio
- `Transaction types`: (not strict, informative)selected transaction types that can be used for this portfolio
- `Responsibles`: (not strict, informative)selected responsibles that can be used for this portfolio
- `Counterparties`: (not strict, informative)selected counterparties that can be used for this portfolio

Portfolio has 2 attributes `First Transaction Date` and `First Cash Flow Date` which are used for performance calculations with workflow and performance report and the logic for them is defined below:

**Logic for defining First Transaction Date &amp; First Cash Flow Date based on complex transactions:**

1. Portfolio entity has 2 properties:
    
    
    1. <span class="code" spellcheck="false">first\_transcation\_date</span> (name = <span class="code" spellcheck="false">First transaction date</span>, value = <span class="code" spellcheck="false">null</span>)
    2. <span class="code" spellcheck="false">first\_cash\_flow\_date </span>(name = <span class="code" spellcheck="false">First cash flow date</span>, value = <span class="code" spellcheck="false">null</span>)
2. **For complex transaction CRUD** operations **For each base transaction** in the complex transaction:
    
    
    1. if **Book**
        
        
        1. if base transaction class == <span class="code" spellcheck="false">Cash-Inflow</span> or <span class="code" spellcheck="false">Cash-Outflow</span>
            
            
            1. if <span class="code" spellcheck="false">trade\_date</span> &lt; <span class="code" spellcheck="false">first\_cash\_flow\_date</span>
                
                
                1. <span class="code" spellcheck="false">first\_cash\_flow\_date</span> = <span class="code" spellcheck="false">trade\_date</span>
        2. if <span class="code" spellcheck="false">trade\_date</span> &lt; <span class="code" spellcheck="false">first\_transcation\_date</span>
            
            
            1. <span class="code" spellcheck="false">first\_transcation\_date</span> = <span class="code" spellcheck="false">trade\_date</span>
    2. if **Rebook !!!**
        
        
        1. if base transaction class == <span class="code" spellcheck="false">Cash-Inflow</span> or <span class="code" spellcheck="false">Cash-Outflow</span>
            
            
            1. if **<u>new </u>**<span class="code" spellcheck="false">trade\_date</span> &lt; <span class="code" spellcheck="false">first\_cash\_flow\_date</span>
                
                
                1. <span class="code" spellcheck="false">first\_cash\_flow\_date</span> = <span class="code" spellcheck="false">trade\_date</span>
            2. else
                
                
                1. if **<u>old </u>**<span class="code" spellcheck="false">trade\_date</span> == <span class="code" spellcheck="false">first\_cash\_flow\_date</span>
                    
                    
                    1. <span class="code" spellcheck="false">first\_cash\_flow\_date</span> = find new <span class="code" spellcheck="false">first\_cash\_flow\_date</span>
        2. if **<u>new </u>**<span class="code" spellcheck="false">trade\_date</span> &lt; <span class="code" spellcheck="false">first\_transcation\_date</span>
            
            
            1. <span class="code" spellcheck="false">first\_transcation\_date</span> = <span class="code" spellcheck="false">trade\_date</span>
        3. else
            
            
            1. if **<u>old </u>**<span class="code" spellcheck="false">trade\_date</span> == <span class="code" spellcheck="false">first\_transcation\_date</span>
                
                
                1. <span class="code" spellcheck="false">first\_transcation\_date</span> = find new <span class="code" spellcheck="false">first\_transcation\_date</span>
    3. if **Delete**
        
        
        1. if base transaction class == <span class="code" spellcheck="false">Cash-Inflow</span> or <span class="code" spellcheck="false">Cash-Outflow</span>
            
            
            1. if <span class="code" spellcheck="false">trade\_date</span> == <span class="code" spellcheck="false">first\_cash\_flow\_date</span>
                
                
                1. if true <span class="code" spellcheck="false">first\_cash\_flow\_date</span> = find new <span class="code" spellcheck="false">first\_cash\_flow\_date</span>
        2. if <span class="code" spellcheck="false">trade\_date</span> == <span class="code" spellcheck="false">first\_transcation\_date</span>
            
            
            1. if true <span class="code" spellcheck="false">first\_transcation\_date</span> = find new <span class="code" spellcheck="false">first\_transcation\_date</span>

#### **Cookbook**

##### *CRUD* 

- **Create: [How to Create a Portfolio Entity](https://docs.finmars.com/books/entities/page/how-to-create-a-portfolio-entity "How to Create a Portfolio Entity")**
- **Read: [How to Read a Portfolio Entity](https://docs.finmars.com/books/entities/page/how-to-read-a-portfolio-entity "How to Read a Portfolio Entity")**
- **Update: [How to Update a Portfolio Entity](https://docs.finmars.com/books/entities/page/how-to-update-a-portfolio-entity "How to Update a Portfolio Entity")**
- **Delete: [How to Delete a Portfolio Entity](https://docs.finmars.com/books/entities/page/how-to-delete-a-portfolio-entity "How to Delete a Portfolio Entity")**

##### *Use Cases*

- Within a portfolio, transactions and instrument positions are grouped using **registers**, which feed into bundles and ultimately affect portfolio-level calculations and reporting.
- Auto-populated fields such as **First Transaction Date** and **First Cash Flow Date** are critical inputs for internal workflows, audit tracking, and performance evaluation logic.
- Leverage the **Portfolio Type** field to define reconciliation logic and reporting behavior (e.g., General, Manual, or Position Only).

#### **F.A.Q.**

Frequently asked questions.

#### **API documentation**

Link to API documentation.

# How to Create a Portfolio Entity

## Prerequisites

We assume you have all prerequisites you may need, including:

1. If needed: the VPN is configured to access the Finmars resources
2. If needed: access to the Virtual Machine to work with the sensitive information
3. Must have: registered in Finmars in the needed region environment (self-registered or registered by Finmars)
4. Must have: having permissions set to allow continue with the Action in the Guide

## Creation of Portfolio Entity

1. Open the ****“Data”**** section in the left-hand side menu. Select the ****“Portfolios”**** <span style="white-space: pre-wrap;">entity from the list under </span>****Data****.  
    [![Снимок экрана 2025-05-04 195556.png](https://docs.finmars.com/uploads/images/gallery/2025-05/scaled-1680-/snimok-ekrana-2025-05-04-195556.png)](https://docs.finmars.com/uploads/images/gallery/2025-05/scaled-1680-/snimok-ekrana-2025-05-04-195556.png)
2. ****Click the “+ Add” button****<span style="white-space: pre-wrap;"> located in the top-left corner of the portfolio list view.</span>  
    [![Снимок экрана 2025-05-04 195818.png](https://docs.finmars.com/uploads/images/gallery/2025-05/scaled-1680-/snimok-ekrana-2025-05-04-195818.png)](https://docs.finmars.com/uploads/images/gallery/2025-05/scaled-1680-/snimok-ekrana-2025-05-04-195818.png)
3. <span style="white-space: pre-wrap;">This action opens the </span>****Add Portfolio****<span style="white-space: pre-wrap;"> form.</span>  
    [![image.png](https://docs.finmars.com/uploads/images/gallery/2025-05/scaled-1680-/image.png)](https://docs.finmars.com/uploads/images/gallery/2025-05/image.png)
4. ****Fill in the required fields in the creation panel:****
    1. ****Portfolio****<span style="white-space: pre-wrap;"> (Full Name) – the unique name of the portfolio. This will be used to identify it across the platform.</span>
    2. ****Portfolio Type –**** select from predefined types (e.g., General, Positional). Determines portfolio behavior and classification.
    3. ****Notes****<span style="white-space: pre-wrap;"> – optional field to add internal comments or details about the portfolio’s purpose or structure.</span>
    4. ****First Transaction Date****<span style="white-space: pre-wrap;"> (auto populated, do not fill) – this field will automatically reflect the earliest transaction date once transactions are associated.</span>
    5. ****First Cash Flow Date****<span style="white-space: pre-wrap;"> (auto populated, do not fill) – similar to the above, it will auto-fill based on actual cash flow activity.</span>
5. Click ****“Create and Exit”****<span style="white-space: pre-wrap;"> to save the portfolio and return to the list view. Alternatively, use </span>****“Create”****<span style="white-space: pre-wrap;"> to save and continue editing.</span>  
    [![Снимок экрана 2025-05-04 200008.png](https://docs.finmars.com/uploads/images/gallery/2025-05/scaled-1680-/snimok-ekrana-2025-05-04-200008.png)](https://docs.finmars.com/uploads/images/gallery/2025-05/scaled-1680-/snimok-ekrana-2025-05-04-200008.png)

# How to Read a Portfolio Entity

#### ****Table of Contents****

- [Description](#bkmrk-description)
- [Examples](#bkmrk-examples)
- [Cookbook](#bkmrk-cookbook)
- [F.A.Q.](#bkmrk-api-documentation)
- [API Documentation](#bkmrk-api-documentation)

#### ****Description****

##### **Financial meaning**

<span style="white-space: pre-wrap;">Financial meaning behind the entity (incl. diagrams and other explanatory materials). </span>

##### **Platform abstraction**

Description of the entity in Platform (incl. diagrams, excel and other explanatory materials on how it works).

#### ****Examples****

<span style="white-space: pre-wrap;">Platform screenshots with a description of a record table example. </span>

#### ****Cookbook****

##### **CRUD**

Operations within platform.

##### **Use Cases**

What for it's used.

#### ****F.A.Q.****

Frequently asked questions.

#### ****API documentation****

<span style="white-space: pre-wrap;">Link to API documentation. </span>

# How to Update a Portfolio Entity

#### ****Table of Contents****

- [Description](#bkmrk-description)
- [Examples](#bkmrk-examples)
- [Cookbook](#bkmrk-cookbook)
- [F.A.Q.](#bkmrk-api-documentation)
- [API Documentation](#bkmrk-api-documentation)

#### ****Description****

##### **Financial meaning**

<span style="white-space: pre-wrap;">Financial meaning behind the entity (incl. diagrams and other explanatory materials). </span>

##### **Platform abstraction**

Description of the entity in Platform (incl. diagrams, excel and other explanatory materials on how it works).

#### ****Examples****

<span style="white-space: pre-wrap;">Platform screenshots with a description of a record table example. </span>

#### ****Cookbook****

##### **CRUD**

Operations within platform.

##### **Use Cases**

What for it's used.

#### ****F.A.Q.****

Frequently asked questions.

#### ****API documentation****

<span style="white-space: pre-wrap;">Link to API documentation. </span>

# How to Delete a Portfolio Entity

#### ****Table of Contents****

- [Description](#bkmrk-description)
- [Examples](#bkmrk-examples)
- [Cookbook](#bkmrk-cookbook)
- [F.A.Q.](#bkmrk-api-documentation)
- [API Documentation](#bkmrk-api-documentation)

#### ****Description****

##### **Financial meaning**

<span style="white-space: pre-wrap;">Financial meaning behind the entity (incl. diagrams and other explanatory materials). </span>

##### **Platform abstraction**

Description of the entity in Platform (incl. diagrams, excel and other explanatory materials on how it works).

#### ****Examples****

<span style="white-space: pre-wrap;">Platform screenshots with a description of a record table example. </span>

#### ****Cookbook****

##### **CRUD**

Operations within platform.

##### **Use Cases**

What for it's used.

#### ****F.A.Q.****

Frequently asked questions.

#### ****API documentation****

<span style="white-space: pre-wrap;">Link to API documentation. </span>