Installation
To install Reflect Stablecoin SDK within your development environment, run the following command:Core
The SDK exposes three core modules:Reflect, a general-purpose class for protocol setup and interactions with base functionalities.ReflectKeeper, a class exposing keeper-level functions necessary for maintenance and risk management. The majority of these functionalities require authentication at the protocol level.PdaClient, a class exposing functions for derivation of PDAs storing state within the Reflect Protocol.
Stablecoins
In most cases, usage of the three classes above will not be necessary for simple integrations and usage of Reflect stablecoins. For every stablecoin, the SDK exposes a separate class equipped with functions for minting, redemption, and administrative features. All these classes follow the schema of theStablecoin superclass.
Stablecoin.ts
Stablecoin classes for all three Reflect stablecoins:
UsdcPlusStablecoin, for integration with USDC+ (Index 0) - LiveUsdjStablecoin, for integration with JLP Hedged (Index 1) - Coming soonLstStablecoin, for integration with LST Delta-Neutral (Index 2) - Live
Creating and redeeming Reflect stablecoins with TypeScript
Follow the scripts below to mint and redeem Reflect stablecoins. AllStablecoin subclasses expose methods following the same schema, so the code below works interchangeably with minor changes.
Yield distribution of the stablecoin
Depending on the selected stablecoin, yield is distributed in one of two ways:- Natively, via the base stablecoin appreciating in value
- Through a “tokenized bond”, a yield-bearing receipt token obtained after depositing the base stablecoin in Reflect Tokenized Bonds program
- Deposit the collateral into a yield-bearing strategy
- Mint the base stablecoin
- Wrap the base stablecoin into a yield-bearing receipt
- Continuously mint more of the base stablecoin against the yield generated from the strategy to keep the price of the base stablecoin at $1 USD
- Deposit stablecoins minted in the following steps to the yield distribution program
Reflect Tokenized Bond
The Reflect SDK exposes aReflectTokenizedBond class. It is an interface for interacting with the tokenized bond program used for distribution of the yield generated by underlying collateral of the Reflect stablecoins. On a daily basis, Reflect protocol keepers monitor the yield generated by Reflect and move it into the yield distribution program.