Skip to content

functori/segmented-cfmm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Segmented CFMM

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.

CameLIGO

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.

Error Codes

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.

Liquidity mining

An example implementation of a liquidity mining contract is also included, see the dedicated document for more info.

Frontend

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.

Testing

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.

Python

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.

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 68.3%
  • TypeScript 16.9%
  • Python 6.4%
  • Nix 3.0%
  • Makefile 2.9%
  • CSS 1.1%
  • Other 1.4%