An equilibrium characterization of the term structure