This repository contains the code needed to generate the figures used in the paper Optimal Routing for Constant Function Market Makers.
The requirements for running these examples are:
NumPyMatplotlibCvxpy(see here for installation)
In order to generate the figures as done in the paper you will also need a working TeX distribution.
All examples are self-contained and can be run directly, e.g.:
python arbitrage.pyThe figures were generated by running
python two-asset.pybut note that this requires a working TeX distribution. (This can be avoided by commenting out any call to latexify in two-asset.py which requires ps as a backend for plotting.)