We study the optimal policies and mean-variance frontiers (MVF) of a multiperiod mean-variance optimization of assets and liabilities (AL). Our model allows for a contemporaneous optimization of the balance-sheet as a whole. This makes the analysis more challenging than in a setting based on purely exogenous liabilities. We show that under general conditions on the joint AL dynamics the arising optimal policies and MVF can be decomposed in an orthogonal set of basis returns. Such a decomposition is derived using a geometric formalism based on exterior algebra which simplifies the computations whenliabilities are endogenous. As a special case, the geometric representation in Leippold, Trojani and Vanini (2004) for the exogenous liabilities case follows directly. We apply such a decomposition to study the structure of optimal policies and MVF under endogenous liabilities and show how to obtain MVF representations that substantially improve analytical descriptions and numerical analysis. We finally illustrate the methodology bystudying the impact of the rebalancing frequency on the MVF and by highlighting in a numerical example the main differences arising when liabilities are exogenous and when they are endogenous.