Skip to main content

Price conversion

The new Price Conversion endpoint turns the information you know about a trade, such as the amount invested, into the price (price) and quantity (quantity) needed to create a transaction.

This is especially useful for banking bonds (CDB, LC, LCI, LCA, LF), whose transactions now require both price and quantity, instead of quantity only.

The request identifies the security (security, by id, isin or cnpj) and the trade date (date), along with the financial amount (notional) or, for CRI, CRA and debentures, the trade rate (multiplier or spread). Supported securities are banking bonds (CDB, LC, LCI, LCA, LF), all types of fund shares and corporate bonds (CRI, CRA and debentures).

For example, to convert BRL 10,000.00 invested in a fund:

// REQUEST
// POST https://core.gorila.com.br/securities/price-conversions

{
"security": {
"cnpj": "26673556000132"
},
"date": "2023-06-23",
"notional": 10000
}
// RESPONSE

{
"security": {
"id": 2363053,
"cnpj": "26673556000132",
"name": "ALASKA INSTITUCIONAL FIA",
"type": "FUNDQUOTE",
"assetClass": "STOCKS"
},
"date": "2023-06-23",
"price": 3.2519722,
"quantity": 3075.0570377
}

The returned price and quantity are ready to use in the Create Transaction endpoint.

Learn more in Price Conversion.