Skip to main content
Mint cTokens (collateral tokens) by depositing assets into Kamino lending reserves. cTokens represent your deposit and accrue interest over time, which can be redeemed later for the underlying asset plus earned interest.

Minting cTokens

Deposit reserve liquidity to receive cTokens in your wallet.
1

Import Dependencies

Import the required packages for Solana RPC communication, Kamino SDK operations, and Kit transaction building.
2

Load Signer and Initialize Market

Load your keypair from a file and initialize RPC connections and the Kamino market.
Replace /path/to/your/keypair.json with the actual path to your keypair file. The KaminoMarket.load() method fetches the current market state including all reserve data.
3

Build Deposit Reserve Liquidity Instructions

Generate instructions to deposit USDC and receive cTokens (kV-STKUSDC) in your wallet.
The buildDepositReserveLiquidityTxns method creates instructions to deposit liquidity into the reserve. This will mint cTokens (e.g., kV-STKUSDC) to your wallet representing your deposit plus accrued interest.
4

Send Setup Transaction (If Needed)

If setup instructions are present, send the setup transaction first and wait for confirmation.
Setup transactions must be confirmed and Address Lookup Tables (ALTs) must be activated before sending the main deposit transaction. Waiting 2 seconds ensures account settlement.
5

Build and Sign Deposit Transaction

Build and sign the main deposit transaction with a fresh blockhash.
A fresh blockhash is fetched for the main transaction to ensure it remains valid after the setup transaction completes.
6

Send and Confirm Transaction

Send the deposit transaction and wait for confirmation to receive your cTokens.
Once the transaction is confirmed, cTokens (kV-STKUSDC) will appear in your wallet. These tokens represent your deposit and will accrue interest over time. You can redeem them later for the underlying asset plus earned interest.