Skip to content

erissatallan/Homotopic-Automated-Market-Maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Homotopic Automated Market Maker

A python implementation of an automated market maker (AMM) for a liquidity pool in DeFi. The market maker is a homotopy between a constant sum market maker (CSMM) and a constant product market maker (CPMM).

Introduction

Automated market makers (AMMs) are used in the DeFi space to enforce desired liquidity characteristics of a token. For instance, a DeFi project may want its token always to be liquid, exponentially appreciating in value as its supply diminishes and therefore being impossible to buy out completely. A constant product marker maker is a straightforward solution for this. In the standard setting, this token would be placed in a liquidity pool along with another suitable token and an equation such as $$X \times Y = k$$ used to govern the buying of one token in amounts of the other. X and Y represent quantities of these tokens in the pool, while k is a constant.

If, instead, a limited supply is desired, a constant sum market maker with the equation $$X + Y = k$$ at its core would be used. This enforces a constant exchange rate and allows for the complete depletion of a token from the pool i.e. $X=0$ or $Y=0$.

Here I describe and characterize an automated market maker arrived at by taking the geometric mean of a Constant Sum Market Maker (CSMM) and a Constant Product Market Maker (CPMM). Such a configuration gives an AMM that displays characteristics of both a CSMM and a CPMM (the CPMM is dominant). This is desirable since apart from liquidity, which a CPMM will always ensure, a CSMM will perform better by other crypto-economic metrics.

Given the present quantities of the currencies in the liquidity pool, the illustrations herein arrive at the immediate exchange rate between the currencies and the amount of one currency to exchange for some amount of the other (taking into consideration that the exchange rate changes marginally for each marginal amount of currency traded).

The characteristics considered are those that pertain to liquidity, particularly the configuration of the automated market maker (AMM) so that the pool is always liquid.

About

A python implementation of an automated market maker (AMM) for a liquidity pool in DeFi. The market maker is a homotopy between a constant sum market maker (CSMM) and a constant product market maker (CPMM).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors