#version #formula #dodo #pmm

pmm_math

Rust Implementation Version of PMM Mathematical Formula Library

2 releases

0.1.1 Nov 9, 2024
0.1.0 Nov 8, 2024

#402 in Math

Download history 187/week @ 2024-11-04 29/week @ 2024-11-11

216 downloads per month

MIT/Apache

17KB
269 lines

Rust Implementation Version of PMM (Proactive Market Maker, aka Concentrated Liquidity Market Maker) Mathematical Formula Library

The Rust version of the pmm mathematical formula library is completely consistent with the DODO PMM interface and implementation on the ETH main network, and can be used for Solana/Near/Polka SmartContract and other frameworks that can write contracts using Rust.

Refer to DODO's eth mainnet code

https://etherscan.io/address/0x5b87acd78283e17bd8c5c532b8086f30dd2f2316#code

Compare

DODO ETH Mainnet Code Rust Implementation
library SafeMath mod safe_math
divCeil div_ceil
sqrt sqrt
--- ---
library DecimalMath mod decimal_math
mulFloor mul_floor
mulCeil mul_ceil
divFloor div_floor
divCeil div_floor_ceil
reciprocalFloor reciprocal_floor
reciprocalCeil reciprocal_ceil
--- ---
library DODOMath mod dodo_math
_GeneralIntegrate general_integrate
_SolveQuadraticFunctionForTarget solve_quadratic_function_for_target
_SolveQuadraticFunctionForTrade solve_quadratic_function_for_trade

No runtime deps