# Oracles and ROI computation

## Price oracles

### cvgOracle

To compute bonds price, Convergence bonds embed a tailored, *generic on-chain oracle* called **`cvgOracle`**. The **`cvgOracle`** can get bonded assets price from multiple AMMs (Uniswap V2\&V3, Sushiswap, Curve...) and is called each time a user buys a bond.

When a bond is deployed, the most liquid pools are targeted by the **`cvgOracle`** (the team will manually set up each bond parameter).

{% content-ref url="/pages/JhQx8PxB6URp1cmciWXX" %}
[Targeted pools](/bonds-and-treasury/bonds/oracles-and-roi-computation/targeted-pools.md)
{% endcontent-ref %}

### Chainlink price feeds

Convergence bonds also include an additional security check based on *Chainlink Price Feeds* (**`CPF`**). Each time a user buys a bond, after the **`cvgOracle`** returns a price, this price is compared to the corresponding asset price given by **`CPF`**. The transaction will fail if the price difference between both Oracles exceeds a given percentage.&#x20;

This security check has been implemented to prevent Convergence bonds from being "exploited" by someone manipulating an underlying pool while allowing the bonding mechanism to function properly during volatility periods.

## ROI computation

Once both oracles returned a corresponding price, the discount (**ROI**) that the bond buyer will get is computed with a mechanism that considers the previous buying activity and the expected buying activity.

For each bond, we define the **ROI** as a function of ( ***NtB(t)**, **Ntr(t)*** ) where ***Ntr(t)*** is the amount of token distributed over time, and ***NtB(t)*** is defined as :

$$
NtB(t) =\sqrt{ \dfrac{t}{T} }\*N
$$

Where ***T*** is the duration of the bond, ***N*** is the total amount of token released, and ***t*** is the duration since the bond has been opened.

The ROI is defined as :

<figure><img src="/files/pOVZPCwgJGM3SAVhPWbf" alt=""><figcaption></figcaption></figure>

More precisely, the **ROI** increases and tends towards the upper bound **ROI** if, during the *bonding round,* the number of **`CVG`** elapsed (***Ntr(t)***) is lower than the theoretical points (***NtB(t)***). It decreases progressively towards zero when ***Ntr(t)*** is higher than ***NtB(t)***.&#x20;

The figure below gives an insight of the ROI behavior :

<figure><img src="/files/utvrCSGOk3YJLZUvGiWU" alt=""><figcaption><p>ROI behavior</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cvg.finance/bonds-and-treasury/bonds/oracles-and-roi-computation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
