zkRisk Engine
Overview
zkRisk is Vest's decentralized risk engine that powers the pricing and risk management across the entire platform. It uses zero-knowledge proofs (ZKPs) to ensure that every trade is priced fairly and that the system remains solvent, without revealing sensitive user data.
Traditional exchanges rely on manual intervention, static risk limits, and reactive liquidations to control systemic risk. In contrast, zkRisk continuously measures the health of the entire ecosystem in real time, using mathematical tools like Expected Shortfall (EVaR) and volatility forecasts. It automatically adjusts prices and funding rates based on how much risk each trade adds to the system, discouraging risky behavior before it becomes a problem.
By embedding these calculations directly on-chain through succinct proofs, zkRisk allows Vest to operate trustlessly: users don't need to rely on the exchange to act fairly — they can verify it for themselves. The result is a decentralized, preventative, and scalable model of risk management designed specifically for next-generation financial ecosystems.
Coherent Risk Measure
Consider markets, where the underlying assets follow a price process
adapted on a filtered probability space
We will define the exchange’s liability at time as a function of , parameterized by the state of the exchange .
Note the following variables and their corresponding definitions:
: the vector of long-short imbalances ($q_i > 0$ implies that the $i$th market is long-heavy, hence the AMM is net short)
: the summation of entry notional sizes (signed) of all open positions
: capital owned by the AMM
: capital provided by LPs
Then Xt, the net payout to traders if all outstanding positions were to be closed at prices St, is given by
In other words, Xt represents the net payout to traders if all outstanding positions were to be closed at prices St.
We use a monetary risk measure — a mapping from a set of random variables to the real numbers — to calculate the amount of capital needed to cover the potential shortfall with high probability. In particular, we adopt an extension of a coherent risk measure called Entropic Value-at-Risk (EVaR).
EVaR is the tightest upper bound to Value-at-Risk (VaR) and Conditional Value-at-Risk (CVaR), derived from the Chernoff bound
. Solving for ,
for a confidence level .
Using EVaR, zkRisk charges premia and funding to guarantee solvency with respect to rolling windows by ensuring the following invariant holds with high probability at t:
.
We define our risk measure as
with capital buffer
.
Here, and are premium and funding collected by the AMM respectively.
We define to ignore upside (i.e., negative shortfall only).
Premia
For a new trade , zkRisk charges premium or provides rebate such that the risk before and after accepting the trade remains invariant. In particular, we define the premium as
where and represent states before and after accepting the trade.
At , AMM-owned capital is incremented by .
Funding
While premia charges for marginal change in risk from the change in liability, zkRisk needs to collect funding from open positions to cover the market risk.
Given our risk measure is 1-positive homogeneous, we use a risk attribution mechanism called Euler allocation to define per-market funding rate. Let be the liability arising from the th market. We calculate the amount of funding assigned to the th market as
This represents the marginal risk added by long-short imbalance in the th market.
We now define instantaneous funding charged across all open positions as
which corresponds to the marginal change in risk with respect to time.
Now, for each trader with position size where , they are responsible for covering
means trader pays the funding, and they receive it otherwise.
Similar to premium, will be incremented at time with funding charged at time .
Last updated
Was this helpful?