mvx_defi_math

Official

Precision DeFi math for MultiversX.

Authormultiversx
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses the critical need for accurate and secure financial calculations within decentralized finance (DeFi) applications on the MultiversX blockchain, preventing common vulnerabilities arising from precision loss and rounding errors.

Core Features & Use Cases

  • Precision Management: Defines and utilizes standard precision levels (BPS, PPM, WAD, RAY) for financial operations.
  • Safe Arithmetic: Implements half-up rounding for multiplication and division to prevent systematic value loss and potential exploits.
  • Secure Rescaling: Provides a safe method for converting values between different precision levels.
  • Percentage Calculations: Offers utilities for applying fees and percentages using BPS and PPM.
  • Use Case: When developing a lending protocol, use this Skill's RAY precision and half-up rounding for interest calculations to ensure fairness and prevent exploits.

Quick Start

Use the mvx_defi_math skill to calculate a 2.5% fee on a principal amount of 1000 WAD using half-up rounding.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: mvx_defi_math
Download link: https://github.com/multiversx/mx-ai-skills/archive/main.zip#mvx-defi-math

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.