By assuming that stochastic discount factor (SDF) M be a proper but unspecified function of state variables X, we show that this function M(X) must solve a simple second-order linear differential equation specified by state variables' risk-neutral dynamics. Therefore, this assumption determines the most general possible SDFs and associated preferences that are consistent with the given risk-neutral state dynamics and interest rate. From a consistent SDF solution then follow the corresponding state dynamics in the data-generating measure. Our approach offers novel flexibilities to extend several popular asset pricing frameworks: affine and quadratic interest rate models, as well as models built on linearity-generating processes. We illustrate the approach with an international asset pricing model in which (i) interest rate has an affine dynamic term structure and (ii) the forward premium puzzle is consistent with consumption-risk rationales, the two asset pricing features previously deemed conceptually incompatible.