# Self financing strategy and repo rate

I was wondering how to adjust the self financing condition when cash borrowing cas be secured by the stock.

Suppose the risk-free money account is $$B_t$$ and there is a risky asset $$S_t$$. One have that $$dB_t=r_tB_tdt$$ where $$r_t$$ is the risk free instantaneous rate.

In the classical seeting, the strategy $$\pi_t = b_tB_t +\varphi_tS_t$$ is self financed if $$d\pi_t = b_t dB_t + \varphi_t dS_t=b_tr_tB_tdt + \varphi_t dS_t$$.

Suppose now that I start from $$t=0$$ with an empty portfolio, I then borrow $$S_t$$, buy a stock and pledge stock to secure the loan. At $$t+dt$$, I would have to pay $$(r_t - q_t)S_t dt$$ worth of interests on the loan, where $$q_t$$ is the stock's repo rate.

What would be $$(b_t,\varphi_t)$$ in that case and where should I account for the repo rate (my guess is that it is in the stock's drift : $$dS_t=(r_t - q_t)dt + \sigma_t dW^Q_t$$) ? Should one add a new money account for stock secured funding ?