A Dynamic Theory of the Balance Sheet