microchipIntegrating 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.

circle-info

For integration assistance:Example repo 👉 r2-protocol-integration-examplearrow-up-right ​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:

circle-info

You can preview the shares obtained via call function

function previewDeposit(uint256 assets) public view returns (uint256 shares)

  1. USDC Approval

User approves the R2Vault contract to spend the specified USDC amount.

  1. Mint Request

Application calls depositViaReferral(uint256 assets,address receiver,uint256 referral) on the R2Vault contract.


Redemption Reserve/Prime (Receive USDC)

circle-info

You can preview the assets obtained via call function

function previewRedeem(uint256 shares) public view returns (uint256 assets)

  1. 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.

  1. 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.

  1. Processing & Settlement

The protocol processes the redemption request according to the settlement cycle (e.g., T+N or batch processing).

  1. 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