I am trying to understand a optimal investment/stochastic control Problem and derive the HJB equation for following Wealth Process
$dX^{\phi}(t)=\int_{0}^{t} X^{\phi}(s-)(r+\phi(s)(\mu-r))ds+\int_{0}^{t} X^{\phi}(s-)\phi(s)\sigma dW(s)+\int_{[0,t]\times [E]}X^{\phi}(s-)\phi(s)\eta(e) d\tilde{N}(ds,de)$
where $W(s)$ is a Brownian Motion and $\tilde{N}(ds,de)$ is a compensated Poisson Random Measure and $\phi$ is the fraction invested in the risky asset. When i apply Ito's Formula I get:
$(1)\: \:dV(t,X^{\phi}_{t})=V_{t}(t,X^{\phi}_{t-})dt+V_{x}(t,X^{\phi}_{t-})dX^{\phi}_{t}+\frac{1}{2}V_{xx}(t,X^{\phi}_{t-})d\langle X^{\phi}\rangle^{c}(t)+\\ \sum_{0\leq s \leq t} V(s,X^{\phi}_{s})-V(s,X^{\phi}_{s-}) - V_{x}(s,X^{\phi}_{s})) {\Delta}X_{s} \\ $
After putting in $dX$ and $\langle X^{\phi}\rangle^{c}(t)$ and rearranging the $ds$ and $dW$ Terms I get (2) $(2)\: \: dV(t,X^{\phi}_{t})=(V_{t}(t,X^{\phi}_{t-})+V_{x}(t,X^{\phi}_{t-})X^{\phi}_{t-}(r+\phi_{t-}(\mu-r))+\frac{1}{2}V_{xx}(t,X^{\phi}_{t-})(X^{\phi}_{t-})^2\phi_{t}^2\sigma^2)dt+V_{x}(t,X^{\phi}_{t-})X^{\phi}_{t-}\phi_{t}\sigma dW(t))+\int_{[0,t]\times [E]} V_{x}(s,X^{\phi}_{s-}) X^{\phi}_{s-}\phi_{s}\eta(e) d\tilde{N}(ds,de) \\ +\sum_{0\leq s \leq t} V(s,X^{\phi}_{s})-V(s,X^{\phi}_{s-}) - V_{x}(s,X^{\phi}_{s})) {\Delta}X_{s}\\=(V_{t}(t,X^{\phi}_{t-})+V_{x}(t,X^{\phi}_{t-})X^{\phi}_{t-}(r+\phi_{t-}(\mu-r))+\frac{1}{2}V_{xx}(t,X^{\phi}_{t-})(X^{\phi}_{t-})^2\phi_{t}^2\sigma^2)dt+V_{x}(t,X^{\phi}_{t-})X^{\phi}_{t-}\phi_{t}\sigma dW(t)) \\ +\sum_{0\leq s \leq t} V(s,X^{\phi}_{s})-V(s,X^{\phi}_{s-}) {\Delta}X_{s}$
I've read that the HJB equation is
$V_{t}(t,x)+rxV_{x}(t,x)+ sup_{ \phi \in \Phi}\{\phi x \mu (u-r) V_{x}(t,x) + x^2 \phi ^2 \sigma^2 \frac{1}{2}V_{xx}(t,x)+\int_{E} V(t,x+\phi x\eta(e))-V(t,x)\nu(de)\}=$
I don't really understand how i get the last Term. I know that the aim is that $dV(t,X^{\phi}_{t})$ is a martingale. So I have to choose $\phi$ so that everything except the $dW(t)$ (which is at least a local martingale) disappears. Then I have to choose the integrand in front of the dt to be zero. However I don't understand how the last term in the HJB equation is connected to the last term in (2) Especially the $\nu$ is confusing me. $\nu$ is the Levy measure i guess. So $\nu(A)$ for $A \in E$ gives me how many Jumps of Size $a \in A$ is expected in one time intervall. Am I right ? How is this connected to the last Term in (2) ?