# 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

(the team will manually set up each bond parameter).**cvgOracle**

### Chainlink price feeds

Convergence bonds also include an additional security check based on *Chainlink Price Feeds* (

). Each time a user buys a bond, after the **CPF**

returns a price, this price is compared to the corresponding asset price given by **cvgOracle**

. The transaction will fail if the price difference between both Oracles exceeds a given percentage. **CPF**

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

*is the amount of token distributed over time, and*

**Ntr(t)***is defined as :*

**NtB(t)**Where * T* is the duration of the bond,

*is the total amount of token released, and*

**N***is the duration since the bond has been opened.*

**t**The ROI is defined as :

More precisely, the **ROI** increases and tends towards the upper bound **ROI** if, during the *bonding round,* the number of

elapsed (**CVG*** Ntr(t)*) is lower than the theoretical points (

*). It decreases progressively towards zero when*

**NtB(t)***is higher than*

**Ntr(t)***.*

**NtB(t)**The figure below gives an insight of the ROI behavior :

Last updated