Getting started with STBL is simple. Below is a quickstart guide to minting, querying, and redeeming with STBL contracts.
Step 1: Minting USST
To mint USST, interact with STBL’s minting contract by providing tokenized RWA collateral (e.g., T-Bills or IIAs). The minting process automatically issues:
- USST: The stablecoin pegged to $1.
- YLD: The yield-bearing token representing interest accrued from the collateral.
Example Contract Interaction:
mint(uint256 collateralAmount) {
// Provide collateral
// Receive USST and YLD tokens
}
The minted USST can be used for transactions, staking in LAMP, or liquidity provision.
Step 2: Querying YLD
You can query YLD to track the yield generated by the underlying asset. The contract updates metadata in real-time, reflecting the current accrued interest and maturity schedule.
Example Contract Interaction: solidity
getYLDYield(address user) {
// Query the yield associated with the user's YLD token
return userYLD.balanceOf(address);
}
Step 3: Redeeming Collateral
To redeem the underlying collateral, return both USST and YLD tokens to the STBL. The contract then releases the collateral and burns the tokens.
Example Contract Interaction:
redeem(uint256 yldAmount) {
// Return USST and YLD
// Unlock collateral and burn tokens
}
This ensures that the collateral can only be unlocked once both the principal (USST) and yield (YLD) components are returned.