  We study the $K$-ring of the wonderful variety of a hyperplane arrangement
and give a combinatorial presentation that depends only on the underlying
matroid. We use this combinatorial presentation to define the $K$-ring of an
arbitrary loopless matroid. We construct an exceptional isomorphism, with
integer coefficients, to the Chow ring of the matroid that satisfies a
Hirzebruch--Riemann--Roch-type formula, generalizing a recent construction of
Berget, Eur, Spink, and Tseng for the permutohedral variety (the wonderful
variety of a Boolean arrangement). As an application, we give combinatorial
formulas for Euler characteristics of arbitrary line bundles on wonderful
varieties. We give analogous constructions and results for augmented wonderful
varieties, and for Deligne--Mumford--Knudsen moduli spaces of stable rational
curves with marked points.
