Mizupay is a DeFi protocol built on Sui that enables users to:
- Deposit LBTC as collateral to mint mzUSD stablecoins
- Stake mzUSD tokens to receive smzUSD which is yield-bearing stablecoin
- Use the yield to claim USDC upfront and use in payment
The vault program allows users to:
- Deposit LBTC as collateral and mint mzUSD stablecoins at a 70% loan-to-value ratio
- Repay mzUSD to unlock and withdraw their LBTC collateral
- Maintain over-collateralization to prevent liquidation
The staking program enables users to:
- Stake mzUSD tokens and receive smzUSD tokens 1:1
- Unstake by burning smzUSD tokens to receive back their mzUSD
A web-based interface for interacting with the protocol, built with:
- TypeScript
- Vite
- React
- Sui Wallet Kit
- Sui CLI tools
- Node.js 16+
- pnpm package manager
# Clone the repository
git clone https://github.com/yourusername/Mizupay.git
cd Mizupay
# Build Sui modules (once the Sui contracts are ready)
# cd program/modules
# sui move build
# Set up the client application
cd client
pnpm install
pnpm dev- Connect your wallet through the client interface
- Navigate to the Mint section
- Deposit LBTC as collateral
- Mint mzUSD tokens (up to 70% of your collateral value)
- Navigate to the Earn section
- Approve mzUSD for staking
- Stake your mzUSD to receive smzUSD tokens
- Unstake anytime by burning smzUSD tokens
- Sui Move modules for vault and staking functionality
Mizupay integrates Pyth Network to fetch the on-chain BTC/USD price that secures the protocol's LTV calculations.
-
On every
deposit & borrowaction the client app- Queries the Hermes service for the latest BTC/USD price-feed update.
- Injects that update into the same transaction via
SuiPythClient.updatePriceFeeds, obtaining a freshPriceInfoObjectid. - Passes the returned
PriceInfoObjectto thelending::borrowMove entry-function, ensuring all collateral checks rely on the most up-to-date oracle data.
-
The Move module
lending.moveuses the suppliedPriceInfoObject(and a time-stamp-verifiedClock) to- calculate
max_borrowableandmax_withdrawable, - validate collateral ratios,
- and remain oracle-agnostic (any asset supported by Pyth can be added in the future).
- calculate
This design removes any need for off-chain price pushers—the oracle update and user operation are executed atomically in a single transaction.
The client application provides a user-friendly interface to interact with the Sui modules, handling:
- Wallet connections via Sui Wallet Kit
- Transaction building and signing
- Real-time updates of user positions
- Responsive UI for both desktop and mobile devices
cd client
pnpm dev # Start development server on port 8080
pnpm build # Build for production
pnpm preview # Preview production build- Dashboard: View your assets, accumulated yield, and staked mzUSD management
- Deposit: Convert BTC to LBTC
- Mint: Lock LBTC and mint mzUSD
- Earn: Stake mzUSD to earn yield with smzUSD
