Skip to main content

Installation

To install Reflect Whitelabel SDK within your development environment, run the following command:

Overview

Use this SDK to interact with Reflect Proxy Program, an onchain infrastructure for minting and redeeming whitelabel yield-bearing stablecoins backed by collateral in Reflect. This SDK offers high-level functionality for creating a new proxy, issuing a branded stablecoin, minting, redeeming, and managing the integration.

Quick Start

To create a new proxy, use the static initialize method on the Proxy class exported from the SDK. When creating a new proxy instance via constructor, the SDK expects onchain accounts to be already initialized and loads them silently. Only use the constructor after setting up the onchain proxy first.
initialize.ts
To load an existing proxy, just use the constructor. In the background, the SDK will lazy-load all the necessary onchain state.
load.ts
If you don’t know the proxy account address, use the loadFromMint method that will load your Proxy when provided with the mint address of your branded stablecoin.
loadFromMint.ts

Proxy Methods

initialize(params)
Creates a new proxy state account with the specified configuration. Parameters:
  • signer: TransactionSigner - The transaction signer who will pay for the transaction
  • authority?: Address - Optional authority address (defaults to signer address)
  • brandedMint: Address - The mint address of the branded token
  • feeBps: number - The fee in basis points (e.g., 100 = 1%)
  • stablecoinMint: Address - The mint address of the underlying stablecoin
Returns: Promise<Instruction> - A create proxy instruction
loadFromMint(params)
Creates a new Proxy instance by deriving the proxy state address from a branded mint. Parameters:
  • connection: Rpc<SolanaRpcApi> - The Solana RPC connection
  • brandedMint: Address - The address of the branded mint
Returns: Promise<Proxy> - A new Proxy instance with loaded state data
load()
Reloads the proxy state data from the blockchain. It is lazily loaded when Proxy instance is initially created. Call to refresh the data. Returns: Promise<void>
deposit(params)
Creates a deposit instruction that converts stablecoins to branded tokens. Parameters:
  • signer: TransactionSigner - The transaction signer who owns the tokens being deposited
  • amount: number - The amount of stablecoins to deposit
Returns: Promise<Instruction> - A deposit instruction
withdraw(params)
Creates a withdraw instruction that converts branded tokens back to stablecoins. Parameters:
  • signer: TransactionSigner - The transaction signer who owns the branded tokens
  • amount: number - The amount of branded tokens to withdraw
Returns: Promise<Instruction> - A withdraw instruction
claimFees()
Creates a claim fees instruction for the proxy authority to collect accumulated fees. Returns: Promise<Instruction> - A claim fees instruction

PdaClient

Utility class for finding PDAs.
deriveProxyState(brandedMint)
Derives the proxy state PDA from a branded mint address. Parameters:
  • brandedMint: Address - The branded mint address
Returns: Promise<[Address, number]> - A tuple containing the PDA address and bump seed

Usage Examples

Creating a New Proxy

Loading and Using an Existing Proxy

Depositing Stablecoins

Withdrawing to Stablecoins

Claiming Fees (Authority Only)

Working with PDAs

Constants

The SDK exports the following constants:
  • PROXY_STATE_SEED - The seed used for proxy state PDA derivation
  • USDC_PLUS_ORACLE - The oracle address tracking the real-time USDC+ exchange rate
  • REFLECT_PROXY_PROGRAM_PROGRAM_ADDRESS - The program ID

Support

For issues, questions, or contributions:

License

MIT License