Skip to main content
This quickstart shows you how to use the following Yieldcoin Manager program instructions:
  • Deposit: Convert underlying assets (USDC) into USYC shares
  • Redeem: Convert USYC shares back into underlying assets
The Yieldcoin Manager program is an audited smart contract that handles USYC subscriptions and redemptions on Solana. It includes the teller for processing deposits and redemptions, a fee configuration account for fee parameters, and a permissioning system for entitled addresses. The TypeScript examples in this quickstart use the Solana Kit library.
The code snippets in this quickstart use Solana devnet addresses. For mainnet addresses, see USYC contract addresses.

Prerequisites

Before you begin, ensure that you’ve:
  • Installed Node.js and npm
  • Obtained an entitled address to interact with the teller and hold USYC

Step 1: Set up the project

This step shows you how to install dependencies and generate the client code you need to interact with the Yieldcoin Manager program.

1.1. Install dependencies

Install the Solana Kit library and token program packages:
Shell

1.2. Generate client code

Generate client code from the Yieldcoin Manager IDL using your preferred code generator, such as Codama or other Solana IDL tools. The generated code provides instruction builders similar to the following:
TypeScript

Step 2: Set up the script

This step shows you how to configure imports, constants, and helper functions for interacting with the Yieldcoin Manager program.

2.1. Define imports and constants

Create a new TypeScript file and add the following imports and constants:
TypeScript

2.2. Define helper functions

Add the following helper functions to derive PDAs, fetch teller data, and send transactions:
TypeScript

Step 3: Subscribe and redeem

This step shows you how to subscribe to USYC (deposit USDC) and redeem USYC (withdraw USDC) using the generated contract functions.

3.1. Subscribe to USYC (deposit)

The deposit operation converts USDC into USYC shares. Add the following code to create a deposit instruction and execute it:
TypeScript

3.2. Redeem USYC

The redeem operation converts USYC shares back into USDC. Add the following code to create a redeem instruction and execute it:
TypeScript