We design a monotone finite difference discretization of the second boundary value problem for the Monge-Ampère equation, whose main application is optimal transport. We prove the existence of solutions to a class of monotone numerical schemes for degenerate elliptic equations whose sets of solutions are stable by addition of a constant, and we show that the scheme that we introduce for the Monge-Ampère equation belongs to this class. We prove the convergence of this scheme, although only in the setting of quadratic optimal transport. The scheme is based on a reformulation of the Monge-Ampère operator as a maximum of semilinear operators. In dimension two, we recommend to use Selling's formula, a tool originating from low-dimensional lattice geometry, in order to choose the parameters of the discretization. We show that this approach yields a closed-form formula for the maximum that appears in the discretized operator, which allows the scheme to be solved particularly efficiently. We present some numerical results that we obtained by applying the scheme to quadratic optimal transport problems as well as to the far field refractor problem in nonimaging optics.