Open Economy Modeling Problem

Hello everyone, I recently started learning about two-country models, and I’m trying to implement a two-country economy, where residents of one country both deposit money to financial institutions and also buy foreign bonds. I have two questions:
(1) I want to include adjustment costs for buying foreign bonds, but since cross-country risk sharing is not possible, how should I determine the missing equation?
(2) If residents in both countries won’t buy domestic bonds, how should the bond market clear? Can this be solved through a government budget? (Adjustment costs paid to the government)

I might not have studied two-country models deeply enough, but these questions are really holding me back from progressing further, and I hope I can get some help here.

I think you need to elaborate more on the structure. I cannot follow the structure you have in mind and the problems you are encountering.

Sorry Professor, my reply is a bit late. I’ve solved part of the research problems for now. I’ve already figured out the steady-state values and the mod file, but the issue now is with the stochastic simulation. I’ve sent my code to your email (my collaborator feels uncomfortable sharing it on a public forum).

The main problem is that I set the shock to increase the interest rate, but the IRF behaves in the opposite way. At the same time, the output variable fluctuates very little and almost immediately returns to the steady state. This doesn’t seem right, but I’ve checked all the code and there doesn’t seem to be any problem.