CVI Platform
A user-friendly and decentralized platform that allows users to actually trade the CVI index according to their belief in the market.
In our efforts to create a full-scale decentralized ecosystem, along with developing the CVI Index, we created a user-friendly platform allowing users to trade the index directly and hedge themselves to market volatility or lack thereof.
The liquidity provided is utilized by the CVI AMM (Automated market marker), which sells volatility according to the index value, it is in essence the other side of every trade done by traders. The AMM takes into account the market demand for volatility in a given moment, as well as risk management metrics of the liquidity providers.

# The AMM pricing mechanism:

The AMM takes into account the demand for volatility at any given moment. The calculation works as follows: We maintain two adjusted volume timestamps, one for deriving open position fees and the other for close position fees. Each of these timestamps always lies within a corresponding time window prior to the current block timestamp.
At the moment, both time windows for the open and close position are set to 2 hours. Every open position event triggers an adjustment of the corresponding
$adjustedVolumeTimestamp$
and the same goes for closePosition events. Each adjustment call first sets
$adjustedTimestamp$
to be
$max(adjustedTimestamp,block.timestamp-volumeTimeWindow)$
and then further advances it according to the following formula:
$adjustedTimestamp=min(block.timestamp,adjustedTimestamp+volumeTimeWindow\cdot\frac{deltaCollateral}{maxVolumeFeeDeltaCollateral})$
This adjustment is designed to respond to sudden surges in open/close position operations as well as positions that greatly affect the collateral ratio in the system. After
$adjustedTimestamp$
is set, volume fees are calculated with respect to the interval in which
$adjustedTimestamp$
lies. The volume fee increases from zero to
$midVolumeFee$
linearly, and then further increases linearly until it reaches
$maxVolumeFee$
when
$adjustedTimestamp$
reaches the current block timestamp.
Right now, since
$midVolumeFee$
is set to zero, volume fees are applied only when
$adjustedTimestamp$
is larger than
$block.timestamp-volumeFeeTimeWindow$
. The volume fee is calculated as follows:
• If
$adjustedVolumeTimestamp\in[block.timestamp-volumeTimeWindow,block.timestamp-volumeFeeTimeWindow]$
, Then:
$midVolumeFee\cdot\frac{adjustedVolumeTimestamp-(block.timestamp-volumeTimeWindow)}{volumeTimeWindow-volumeFeeTimeWindow}$
• If
$adjustedVolumeTimestamp\in[block.timestamp-volumeFeeTimeWindow,block.timestamp]$
, Then:
$midVolumeFee+(maxVolumeFee-midVolumeFee)\cdot\frac{adjustedVolumeTimestamp-(block.timestamp-volumeFeeTimeWindow)}{volumeFeeTimeWindow}$