Skip to main content

Security

All available securities in Gorila, which can be priced and added to a portfolio, are called Securities.

Most of them are directly available to be added to one's portfolio using transactions, while some must first be created in the organization's scope before they can be used.

Every security has a unique identifier (securityId), but depending on its type, you can identify a security by other known identifiers used by financial market participants, such as ISIN for most exchange-listed securities or CNPJ for Brazilian funds.

Security Types

Security types are groupings that separate securities by similarities in terms of their nature, type of calculation, and information required to express a transaction. It's a type of grouping similar to an asset class. Here are the security types (click the link to see an example of a transaction with each of them):

Security types managed by Gorila

Security types that need to be created

Creating Securities

Let's explore the three cases for creating a security, their motivation, and a practical example for each.

Fixed and Floating Banking Bonds (CDB, LC, LCA, LCI, LF)

For some corporate bonds, there's little to none organized secondary market. Since there's no significant organized/exchange or organized OTC market that provides pricing, there's also no public identifier for a given bond and no generally accepted mark-to-market pricing source. These are simple fixed-rate or floating-rate bonds linked to a benchmark and their type or interest rate vary according to each deal.

For those reasons, you first need to create the bond before creating transactions that refer to it. The following bonds fall into that criteria:

  • CDB (Certificado de Depósito Bancário) - CORPORATE_BONDS_CDB
  • LC (Letra de Câmbio) - CORPORATE_BONDS_LC
  • LCA (Letra do Crédito do Agronegócio) - CORPORATE_BONDS_LCA
  • LCI (Letra de Crédito Imobiliário) - CORPORATE_BONDS_LCI
  • LF (Letra Financeira) - CORPORATE_BONDS_LF

Below are two examples (one for a fixed and one for a variable bond) of the payloads we need to model the bonds:

Example for Fixed Rate CDB - Type: FIXED_RATE_BANKING_BOND

//REQUEST
//POST https://core.gorila.com.br/securities

{
"type": "FIXED_RATE_BANKING_BOND",
"bankingBondType": "LCA",
"initialDate": "2020-01-01",
"maturityDate": "2040-12-31",
"issuerId": "03215790000110",
"yield": 0.05
}

The response will return the Id (securityId) of the newly created security:

//RESPONSE

{
"id": 44789070
}

Now you can create a transaction with the security:

//REQUEST
//POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-01-04",
"quantity": 100,
"brokerId": "58160789000128",
"security": {
"id": 44789070
},
"side": "BUY"
}

Example for Floating Rate CDB - Type: FLOATING_RATE_BANKING_BOND

//REQUEST
//POST https://core.gorila.com.br/securities

{
"type": "FLOATING_RATE_BANKING_BOND",
"bankingBondType": "CDB",
"initialDate": "2020-01-01",
"maturityDate": "2040-12-31",
"issuerId": "03215790000110",
"index": "CDI",
"multiplier": 1.25
}

Note: The multiplier field is only used when the securities remuneration is post-fixed, that is, it is a % of an index, such as %CDI. In the case of assets with hybrid remuneration, such as IPCA+, or CDI+, the field used should be the spread.

The response will return the Id (securityId) of the newly created security:

//RESPONSE

{
"id": 44789069
}

Now you can create a transaction with the security:

//REQUEST
//POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2022-01-04",
"quantity": 100,
"brokerId": "58160789000128",
"security": {
"id": 44789069
},
"side": "BUY"
}

Stock Forwards (FORWARD_STOCK)

Stock forwards are customized contracts between two counterparties who agree to buy or sell a stock at a specified price on a future date (which is also the expiry date of the contract). Since forward contracts are traded over-the-counter and can be customized between parties, you'll need to create them before registering a transaction. To create a stock forward contracts, you'll need to specify the following informations:

  • The underlying stock, represented by its securityId
  • The initial date (akin to an issuance date)
  • The expiry date

Example for Stock Formards - Type: FORWARD_STOCK

//REQUEST
//POST https://core.gorila.com.br/securities

{
"type": "FORWARD_STOCK",
"underlyingSecurity": {
"id": 4855044
// you can also use ISIN: "BRPETRACNPR6"
},
"initialDate": "2023-01-01",
"maturityDate": "2023-12-31"
}

The response will return the Id (securityId) of the newly created security:

//RESPONSE

{
"id": 44789071
}

Now you can create a transaction with the security:

//REQUEST
//POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-02-01",
"quantity": 100,
"brokerId": "58160789000128",
"security": {
"id": 44789071
},
"side": "BUY",
"price": 25
}

Custom Securities (GENERIC)

To learn more about creating and managing custom securities, click here.