= \pi^i_t X_t^i (\mu_i dt + \nu_i dW^i_t + \sigma_i dB_t) - c^i_t X^i_t dt, \hspace{0.5 cm} X_0^i = x_0^i,$$ with $(Y_t)_{t \in [0,T]}$ solving (\[processY\]). Treating $(X^i,Y)$ as the state process, we solve this stochastic optimal control problem by noting that the value (\[opt\]) should equal $v(X_0^i, Y_0, 0)$, where $v(x,y,t)$ solves the HJB equation $$\begin{split}
0=v_t &+ \sup_{\pi \in \R} \left[ \pi(\mu_i x v_x + \sigma_i \widehat{\sigma \pi}_{-i} xy v_{xy}) + \frac{1}{2}  \pi^2\Sigma_i x^2 v_{xx}\right] \\
&+ \sup_{c \in \R_+} \left[- c x  v_x + U\left((cx)^{(1 - \theta_i/n)}(\bar{c}_{-i}(t)y)^{- \theta_i}; \delta_i \right) \right] \\
&+ (\eta_i - \widehat{c}_{-i}(t))y v_y + \frac{1}{2}\left(\frac{1}{n} \widehat{(\nu \pi)^2}_{-i} + \widehat{\sigma \pi}_{-i}^2 \right) y^2 v_{yy},
\end{split} \label{pf:HJB}$$ for $(x,y,t) \in \R_+ \times \R_+ \times [0,T)$, with terminal condition $$\begin{aligned}
v(x,y,T) = \epsilon_i  U(x^{1 - \theta_i/n}y^{- \theta_i}; \delta_i). \label{pf:HJB-boundary}\end{aligned}$$ Notice that the two suprema in are finite if $v_{xx} < 0$ and $v_x > 0$, so we assume for the moment that this is the case, and we will ultimately check that our solution does satisfy these constraints. If follows from a standard verification theorem that there can be at most one classical solution of this PDE. Since the utility takes a different form depending on 