Implementation of a constant product market making smart-contract, which allows the curve to be defined on price segments.
Based on the ideas described in the Uniswap V3 whitepaper.
The ligo directory contains a CameLIGO implementation of the smart-contract, which adhears to the contract specification.
For instructions on how to compile the contract and/or its storage, please refer to the compilation document.
In error scenarios, the contract fails with an error code.
See the error codes document for the list of possible error codes and their description.
An example implementation of a liquidity mining contract is also included, see the dedicated document for more info.
A frontend application is included to interact with a deployed instance of the contract.
For more information and instructions on how to run it locally, please refer to its documentation.
This repository includes several property-based and example-based tests, implemented with the cleveland test framework in the haskell/test directory.
For more information and instructions on how to run the tests, please refer to its documentation.
The python directory contains a quick and dirty implementation in Python that makes no effort to implement integer based arithmetic, in order to ensure that the general logic of the contract is sound. The mutmut mutation testing framework was used to improve the test coverage.
The compute_ladders.py script uses Sage to generate some of the constants useful to compute exponentiations in the contract and verify that the precision obtained is sufficient.