  We study Monge-Amp\`ere gravity (MAG) as an effective theory of cosmological
structure formation through optimal transport theory. MAG is based on the
Monge-Amp\`ere equation, a nonlinear version of the Poisson equation, that
relates the Hessian determinant of the potential to the density field. We
explain how MAG emerges from a conditioned system of independent and
indistinguishable Brownian particles, through the large deviation principle, in
the continuum limit. To numerically explore this highly non-linear theory, we
develop a novel N-body simulation method based on semi-discrete optimal
transport. Our results obtained from the very first N-body simulation of
Monge-Amp\`ere gravity with over 100 millions particles show that on large
scales, Monge-Amp\`ere gravity is similar to the Newtonian gravity but favours
the formation of anisotropic structures such as filaments. At small scales, MAG
has a weaker clustering and is screened in high-density regions. Although here
we study the Monge-Amp\`ere gravity as an effective rather than a fundamental
theory, our novel highly-performant optimal transport algorithm can be used to
run high-resolution simulations of a large class of modified theories of
gravity, such as Galileons, in which the equations of motion are second-order
and of Monge-Amp\`ere type.
