# Portfolio Utility Function Example

### Markowitz Portfolio Utility Function for THEO AMM

#### Single Option Case

Consider the following utility function which balances returns on capital with risk, M=G−0.5∗λ∗V where G is expected gain in capital, is a risk aversion parameter and V is the variance of G. We seek to maximize M.
For a given option, since we expect to close the position for theoretical value, G=E(theo−p0)∗q=(E(theo)−p0)∗q, where theo is the theoretical value, p0 is our original trade price and q is our position size. Over a short enough time duration where we can ignore the effect of theta and with a delta-hedged position, E(theo)=theo , therefore G=theo-p0*qG=theo−p0∗q
Next, assuming a delta-hedged position and negligible effect of theta,
$dTheo=dIv*(dpnl/dIv)$
and , therefore,
$dCapital=dIv*vega*q$
. Assuming implied volatility is normally distributed, the variance of capital is then
$Variv*vega^2*q^2 = vov^2*vega^2*q^2$
, where iv is the annualized implied vol of the option and vov is the annualized vol of implied vol of the option.

#### Multiple Instruments

We can extend the above result to multiple instruments by replacing q with a vector of quantities for each instrument q, edge theo-p0 with a vector of edges e, and Var with a covariance matrix , s.t
We then get that .