Peg Stability Module
Overview
The Peg Stability Module (PSM) is an essential component of the Nivela Protocol, designed to keep nUSD stable at $1. It achieves this by leveraging three stablecoins: nUSD (the target stablecoin) and USDC/USDT, which help maintain the peg.
Features
Convert Functionality:
Users can exchange nUSD for USDC at a fixed rate of 1 nUSD = $1.
Users can deposit nUSD into the PSM and receive USDC, provided sufficient liquidity is available.
Users can deposit USDC into the PSM and receive nUSD, as long as the PSM has not exceeded its maximum nUSD minting limit.
No Fees: The PSM operates without charging any fees.
Oracle Price Integration: The PSM uses an oracle to assess the USD value of stablecoins, ensuring nUSD remains accurately pegged.
Oracle Price Integration
To ensure nUSD remains accurately pegged, the PSM integrates with the Resilient Oracle, which determines the USD value of the paired stablecoin. The following rules apply:
swapnUSDForStable (User Sends nUSD, Receives USDC)
If the oracle price of the stablecoin is below $1: The conversion rate is fixed at 1 stablecoin = $1.
Example: If 1 USDC = $0.90, but the user wants 1 USDC, the conversion rate remains 1 USDC = $1 = 1 nUSD.
The user must send 1 nUSD to receive 1 USDC.
If the oracle price of the stablecoin is above $1: The conversion rate follows 1 stablecoin = oracle price.
Example: If 1 USDC = $1.10, and the user wants 10 USDC, the conversion rate becomes 1 USDC = $1.10 = 1.1 nUSD.
The user must send 11 nUSD to receive 10 USDC.
swapStableFornUSD (User Sends USDC, Receives nUSD)
If the oracle price of the stablecoin is below $1: The conversion rate follows 1 stablecoin = oracle price.
Example: If 1 USDC = $0.90, and the user deposits 10 USDC, the conversion rate becomes 10 USDC = $9 = 9 nUSD.
The user receives 9 nUSD.
If the oracle price of the stablecoin is above $1: The conversion rate is fixed at 1 stablecoin = $1.
Example: If 1 USDC = $1.10, and the user deposits 10 USDC, the conversion rate is 10 USDC = $10 = 10 nUSD.
The user receives 10 nUSD.
Last updated