We construct and estimate a joint model of macroeconomic and yield curve dynamics. A small-scale rational expectations model describes the macroeconomy. Bond yields are affine functions of the state variables of the macromodel, and are derived assuming absence of arbitrage opportunities and a flexible price of risk specification. While maintaining the tractability of the affine set-up, our approach provides a way to interpret yield dynamics in terms of macroeconomic fundamentals; time-varying risk premia, in particular, are associated with the fundamental sources of risk in the economy. In an application to German data, the model is able to capture the salient features of the term structure of interest rates and its forecasting performance is often superior to that of the best available models based on latent factors. The model has also considerable success in accounting for features of the data that represent a puzzle for the expectations hypothesis.