Debt / Trade Balance Inquiry

Hello, I hope someone can provide some direction on a Dynare model I am working on.
I have two agents:
• a Ricardian agent who trades in domestic government debt (denoted Bg) & foreign (bonds denoted Bp) markets. Let total domestic savings B=Bp+Bg
• a non-Ricardian who does not have access to bonds or capital
The model is an open DSGE economy. I link a price subsidy based on an exogenous price shock, which raises government debt; however in the same model but with no subsidy, Ricardians have no government debt but only foreign savings. In both cases total savings B is basically the same, which I interpret as limit on the value that can be saved, i.e. agents can only save so much of Bp and Bg. This is quite an important outcome of the model, since the value of Bp directly affects the trade balance (model is based on Schmidt-Grohe & Uribe), but I am unsure whether this is right. Hence, if there is more domestic debt, Ricardians will own less foreign bonds which then lowers the trade balance. Said differently, if the government does not increase debt, Ricardians will purchase more foreign bonds and the trade balance becomes more positive.

Is there a paper to your knowledge that overlaps with this issue, or is there any advice? Or perhaps the outcome is a major assumption of the model.
Thank you in advance for any suggestions!

This is not my literature, but what you describe sounds like a portfolio choice problem of the Devereux/Sutherland type. I am not sure the standard Dynare routines can provide you with meaningful results that were not previously hard-coded into your model.