> For the complete documentation index, see [llms.txt](https://docs.cvi.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cvi.finance/cvi-ecosystem/cvi-v4/execution-gap.md).

# Execution gap

CVI v4 now supports opening/closing positions in near real-time (several seconds) via a new position execution logic. Instead of using the CVI oracle value as the sole price for settling trades, a secondary oracle is used in parallel to fetch the raw real-time CVI value. A combination of the two values is used to safely and reliable execute trades in real-time, while preventing front-running the CVI oracle.\
\
The CVI oracle value is computed by Chainlink's decentralised oracle network and includes an adaptive exponential moving average in order to increase its reliability. \
In parallel to it, the raw cvi value is updated in real-time and is pulled on-demand whenever a trader executes a trade.\
\
The execution logic works as follows:\
\
Price for opening a position = Max(CVI Oracle value, Raw CVI value)\
Price for closing a position = Min(CVI Oracle value, Raw CVI value)\
\
Execution gap = Math.abs(1 - CVI Oracle value / Raw CVI Value)<br>
