Refer User Without Deposit
Create a UserMetadata account with a referrer without requiring an initial deposit. This allows you to link a referrer to a user before they perform any lending operations.The referrer must be set when the UserMetadata account is created and cannot be changed afterward.
- TypeScript
- Rust
1
Import Dependencies
2
Initialize RPC and Load Market
3
Check Existing User Metadata
4
Build User Metadata Setup Instructions
The referrer’s wallet must have Kamino user metadata itself. The instructions also create the wallet’s lookup table;
false skips filling it. For a wallet that already has user metadata, the SDK returns no instructions.5
Build the Transaction
6
Sign and Send
User metadata created. The referrer is now linked to the wallet and earns a share of the interest it pays on borrows.
When to Use This vs Deposit with Referral
When to Use This vs Deposit with Referral
Use this method when:
- You want to link a referrer to a user before they make their first deposit
- You’re creating UserMetadata as a separate step from deposit operations
- You have a simpler flow that doesn’t require immediate deposit
- You want to combine UserMetadata creation and deposit in a single transaction
- The user is ready to deposit immediately
- You want to minimize the number of transactions