Module Cpmm_logic.Simulate_raw

This is a simulation of the CPMM contract, as implemented in mligo in src/proto_alpha/lib_protocol/contracts/cpmm.mligo. The interested reader should look for comments in this file to gain a better understanding of the contract logic.

val addLiquidity : tokenPool:Z.t -> xtzPool:Mavryk_protocol_alpha.Protocol.Alpha_context.Tez.t -> lqtTotal:Z.t -> amount:Mavryk_protocol_alpha.Protocol.Alpha_context.Tez.t -> Z.t * Z.t
val removeLiquidity : tokenPool:Z.t -> xtzPool:Mavryk_protocol_alpha.Protocol.Alpha_context.Tez.t -> lqtTotal:Z.t -> lqtBurned:Z.t -> Mavryk_protocol_alpha.Protocol.Alpha_context.Tez.t * Z.t
val tokenToXtz : tokenPool:Z.t -> xtzPool:Mavryk_protocol_alpha.Protocol.Alpha_context.Tez.t -> tokensSold:Z.t -> Mavryk_protocol_alpha.Protocol.Alpha_context.Tez.t * Z.t
val tokenToToken : tokenPool:Z.t -> xtzPool:Mavryk_protocol_alpha.Protocol.Alpha_context.Tez.t -> tokensSold:Z.t -> Mavryk_protocol_alpha.Protocol.Alpha_context.Tez.t * Z.t