I am currently working on a medium scale two country model as in Akinci/Queralto (2019) (link 2) and Baernjee/Devereux/Lombardo (2015) (link 2) and I am struggling in deriving the aggregate budget constraint from the households resource constraint. The first one describes the evolution of net foreign assets as a function of the current account. I am sure that the equation described by the authors is correct, as it is simply an accounting identity, which should hold in every DSGE model. But I dont simply want to write down the equation without knowing how to explicitly derive it. My question is thus: how did they get there?

In these models households dont directly invest into foreign bonds, but rather provide deposits to the domestic bank, which in turn lends to or borrow from the foreign country in foreign currency. Banks in these models are Gertler/Karadi type and as such a fraction of the people in the household, while the other remaining part are workers. The households budget constraint contains the banks profits, but I am struggling to write down those profits such that I end up at the aggregate budget constraint. Does anyone know of a paper or appendix that contains detailed derivations on how to aggregate Gertler/Karadi type banks (be it in a closed or open economy) into the aggregate budget constraint?

thank you very for the response. That was indeed a good link. But I am still a bit puzzled in the sense, that I am used to aggregating over the households budget constraint and profits in order to get to the aggregate economy period by period budget constraint. Am I right to assume that in a model with these types of banks, this is not all there is to do? Let me illustrate what I mean. The paper you linked states the following household budget constraint

and it defines aggregate profits as

where the second line are profits distributed to the household from the exiting banker.

The surviving bankers net worth evolves according to:

and ultimately the aggregate budget constraint is given by:

Am I right to assume that I should be able to derive the economy wide budget constraint by first aggregating over the household budget constraints and then adding the net worth of the banking sector, as the latter is also part of the economy/household?

Given that in these kinds of models the banker is also a part of the household, wouldnt it be cleaner to state that the aggregate change in net worth (i.e. the sum of the second line in the profit equation and equation 24)) is part of the households budget constraint?

In any case, thank you so much for the link. I hope I am on the right track here.