Abstract. We present a new framework for a broad class of affine Hecke algebra modules, and show that such modules arise in a number of settings involving representations of padic groups and R-matrices for quantum groups. Instances of such modules arise from (possibly non-unique) functionals on p-adic groups and their metaplectic covers, such as the Whittaker functionals. As a byproduct, we obtain new, algebraic proofs of a number of results concerning metaplectic Whittaker functions. These are thus expressed in terms of metaplectic versions of Demazure operators, which are built out of R-matrices of quantum groups depending on the cover degree and associated root system.An important tool in studying representations of p-adic groups is the affine Hecke algebra. Ion [28], Brubaker, Bump and Licata [8], Brubaker, Bump and Friedberg [7,9] and other papers considered representations of Hecke algebras related to models of representations of p-adic groups. These works mainly focused on unique functionals such as the Whittaker, spherical and Bessel functionals, but, as we shall show here, the ideas are also applicable to certain non-unique functionals on central extensions of p-adic groups. The goal is to show that these functionals act as Hecke algebra module maps to various target spaces. This results in recursion formulas for Iwahori fixed vectors in the model using Demazure-like operators based on the Hecke action. It allows for effective computation, provides links to the geometry of associated Bott-Samelson varieties, and proves that these functions match important classes of symmetric functions, such as various specializations of non-symmetric Macdonald polynomials.In a separate direction, Brubaker, Bump and Friedberg [6] showed that the values of the spherical Whittaker function for unramified principal series of GL r (F ), where F is a p-adic field, may be realized as partition functions of a solvable lattice model. A similar model for the spherical Whittaker functions for covers of GL r (F ) -a situation in which the Whittaker functional is no longer unique -was given in Brubaker, Bump, Chinta, Friedberg and Gunnells [5]. However, except when the cover is trivial, this model was not solvable in the sense of Baxter [3]. The Boltzmann weights were altered to obtain a solvable model in Brubaker, Buciumas and Bump [4]. This is the "metaplectic ice" of the title. Moreover, [4] provided a new algebraic framework, relating the models to the R-matrices of a Drinfeld twist of the quantum affine Lie superalgebra U q ( gl(n|1)). As a biproduct of this discovery, a relationship between the scattering matrices of the intertwining integrals on Whittaker coinvariants and R-matrices of a Drinfeld twist of U q ( gl(n)) came to light.In the present paper, we will unify these directions by providing simultaneous foundations for both. The search for new foundations is motivated by the following consideration. In [7], we took the point of view of the universal principal series. This means that the induced character becomes C[Λ]...