In this paper, we consider an entrepreneur who has no assets in place but possesses an option to invest in a project incurring a lump-sum investment cost, of which a fraction must be financed by entering into an equity-for-guarantee swap. The entrepreneur is exposed to macroeconomic risk as well as idiosyncratic risk. The former is described by a regime-switching process, while the latter is described by a geometric Brownian motion. We derive the corporate security prices, guarantee costs, optimal investment and financing policy. Numerical analysis demonstrates that the entrepreneur post- pones investment in a boom but accelerates it in a recession. The optimal leverage ratio is countercyclical when the project’s idiosyncratic risk is low and vice versa. The swap mechanism eliminates ex post agency conflicts between borrowers and lenders, but conflicts of interest between borrowers and insurers appear, which lead to inefficiencies from asset substitution and debt overhang. These are generally not so obvious in a boom or if a boom occurs frequently. The swap discussed here overcomes financial friction and increases firm value as well.