(3.4) equates the marginal cost of labour to marginal product of labour and, thus, can be thought of as the labour demand function by entrepreneur j. (3.5) equates the expected marginal cost of capital financed by debt to the expected marginal return of capital financed by debt and can be thought of as capital demand function by entrepreneur j. Since stochastic survival rate, $ \gamma_{t+1}^{E} $ , is uncorrelated to any other shocks in the economy, (3.5) can be further rearranged as follows:

$$ E_{t}\left[\frac{R_{t}^{E}(j)}{\pi_{t+1}}\right]=E_{t}\left[\frac{\alpha p_{t+1}^{mc}(j)y_{t+1}(j)/k_{t+1}(j)+(1-\delta)q_{t+1}}{q_{t}}\right] $$

Under the assumption of risk-neutrality, the introduction of the stochastic survival rate will not alter the capital demand equation for any entrepreneur j compared to the case with a constant survival rate, as described by BGG (1999).

#### 3.1.3 Debt Contract

Each period, entrepreneur j issues a debt and engages in a debt contract with an arbitrary chosen financial intermediary m, where m is an indexed number uniformly distributed from 0 to 1. The debt contract is for one period only, and if entrepreneur j needs to issue a debt again the next period, another arbitrary financial intermediary $ m' $ will be chosen for the next period. Following BGG's (1999) recommendations, the idiosyncratic TFP shock, $ \omega_{t}(j) $ , is the private information of entrepreneur j and there exists asymmetric information between entrepreneur j and financial intermediary m. Due to the costly state verification, financial intermediary m cannot observe entrepreneur j's output without cost but needs to incur a monitoring cost to observe it. Entrepreneur j, after observing the project outcome, will decide whether to repay the debt or to default at the beginning of period t. If the entrepreneur decides to repay, the financial intermediary will receive repayment of $ R_{t-1}^{E}(j)/\pi_{t} $ for each unit of outstanding credit, regardless of the realization of the idiosyncratic shock. Otherwise, the financial intermediary will pay a monitoring cost to observe $ y_{t}(j) $ and to seize the project outcome from the entrepreneur.

Under the optimal debt contract, BGG (1999) showed the external finance premium, $ s_{t}(j) $ , to be an increasing function of the leverage ratio. For estimation purposes, we followed Christensen and Dib's (2008) specification of the external finance premium as follows:

$$ s_{t}(j)=\left(\frac{q_{t}k_{t+1}(j)}{n_{t}^{E}(j)}\right),\varphi $$

where parameter $ \varphi > 0 $ can be interpreted as the elasticity of the external finance premium with respect to the leverage ratio. In addition, discounting the external finance premium from the borrowing rate $ R_{t}^{E}(j) $ , the expected risk-adjusted nominal return for financial intermediary m from the debt contract from period t to $ t + 1 $ can be expressed as follows:

$$ E_{t}R_{t+1}^{F}(m)=\frac{R_{t}^{E}(j)}{s_{t}(j)}. $$

#### 3.1.4 Aggregation

Since bankruptcy cost is constant-return-to-scale and since leverage ratios are equal for all entrepreneurs j, the external finance premium is equal across all solvent entrepreneurs in equilibrium, i.e., $ s_{t} = s_{t}(j) $ for all j. Since (3.6) holds at the aggregate level, the nominal borrowing rates across all solvent entrepreneurs become equal, i.e.: $ R_{t}^{E} = R_{t}^{E}(j) $ for all