plutus-use-cases- Collection of smart contracts to develop the plutus/wallet interface
Safe HaskellNone




calculateInitialLiquidity :: Amount A -> Amount B -> Amount Liquidity Source #

The initial liquidity is 'ceil( sqrt(x*y) )' where x is the amount of 'Coin A' and y the amount of 'Coin B'. See Eq. 13 of the Uniswap v2 paper.

checkSwap :: Amount A -> Amount B -> Amount A -> Amount B -> Bool Source #

A swap is valid if the fee is computed correctly, and we're swapping some positive amount of A for B. See: Eq (11) (Page 7.)

lpTicker :: LiquidityPool -> TokenName Source #

Generate a unique token name for this particular pool; based on the tokens it exchanges. This should be such that looking for a pool exchanging any two tokens always yields a unique name.