multiversx-defi-math - MultiversX DeFi Math Patterns for Smart Contracts
Reusable financial math patterns for MultiversX smart contracts covering precision management, half-up rounding, safe rescaling, and percentage calculations.
Tags
Updated: 2026-06-30Capabilities
Typical Inputs
Typical Outputs
What this skill does
- Define precision levels BPS PPM WAD RAY
- Perform unsigned half-up multiplication
- Perform unsigned half-up division
- Perform signed away-from-zero rounding
- Rescale values between precision levels
- Calculate percentage fees with proportion
- Apply basis points math
- Apply parts-per-million math
- Generate shared math module template
- Identify rounding attack vectors
Inputs
- MultiversX smart contract codebase
- Token decimal properties
- Fee rate parameters
- Precision level requirements
Outputs
- Rust code snippets for financial math
- Shared math module template
- Rounding strategy implementations
Requirements
- MultiversX smart contract development environment
- Rust programming language
- MultiversX framework (multiversx_sc)
