Integrating R2 Vault
This document outlines the required steps for integrating with the R2 Protocol, enabling applications to support USDC deposits, Reserve/Prime issuance, and redemptions. All yield operations are fully managed by the protocol’s on-chain YieldManager, requiring no additional integration effort.
For integration assistance:Example repo 👉 r2-protocol-integration-example About referral code, Request partnership referral codes from the official team.
Components
Primary user-facing contract used for:
Minting Reserve/Prime (via USDC deposits)
Redeeming Reserve/Prime (receiving USDC)
Deposit (Mint Reserve/Prime)
To mint Reserve/Prime, applications must perform the following:
You can preview the shares obtained via call function
function previewDeposit(uint256 assets) public view returns (uint256 shares)
USDC Approval
User approves the R2Vault contract to spend the specified USDC amount.
Mint Request
Application calls depositViaReferral(uint256 assets,address receiver,uint256 referral) on the R2Vault contract.
Redemption Reserve/Prime (Receive USDC)
You can preview the assets obtained via call function
function previewRedeem(uint256 shares) public view returns (uint256 assets)
Share Token Approval
The user first calls approve(address spender, uint256 value) on the Reserve/Prime contract, authorizing the R2Vault contract to spend the specified amount of Reserve/Prime on their behalf.
Redeem Request Submission
The application calls requestRedeem(uint256 shares,address receiver,address owner) on the R2Vault contract. The specified Reserve/Prime amount is locked (transferred to the vault), and a redemption request record is created. The request enters the pending state.
Processing & Settlement
The protocol processes the redemption request according to the settlement cycle (e.g., T+N or batch processing).
Funds Received
The user receives USDC in their wallet, and the redemption request is marked as completed.
Yield strategies, allocation logic, and fund migrations are abstracted and require no integration work.
Last updated