Skip to content

A cfmm with a curve that's flat in the middle

Notifications You must be signed in to change notification settings

berndoostrum/flat-cfmm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Flat CFMM

CFMM between two tokens (FA1.2 / FA2 each) using the isoutility curve U(x,y) = (x+y)^8 - (x-y)^8 This curve has the benefit of being extremely flat around x = y, at which point dx U / dy U = -1. This makes it suitable to create a CFMM between two assets which ought to be pegged to one another.

Based on the generic cfmm in the ctez repo which is itself based on dexter v2.

Barely tested!

The curve

Curve showing the constant product curve, the constant sum curve, and the compromise

To give some sense, when the two assets are held in equal amounts, 78% of the pool can be bought for a slippage of less than 5%.

Slippage for constant product, sum, and the compromise

About

A cfmm with a curve that's flat in the middle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published