Skip to main content
This tutorial walks through a complete integration: supplying funds, tracking yield, and unwinding positions. We’ll build a simple yield service that your application can use.

Setup

Step 0: Register the Wallet

Register the user’s wallet before any operations:
You can now use walletAddress, walletId, or userId in all subsequent calls. All examples below use walletAddress.

Step 1: Discover Venues and Strategies

First, find available yield opportunities for the user:

Step 2: Check Existing Allocations

Before supplying, check what the user already has:

Step 3: Plan a Supply Operation

Create an operation and get the unsigned transaction:

Step 4: User Signs the Transaction

Present the transaction to the user for signing. This example uses @solana/web3.js:

Step 5: Submit Transaction Hash

After broadcasting, notify RebelFi:
Alternatively, use submitSigned to let RebelFi broadcast the transaction for you.

Step 6: Poll for Confirmation

Wait for on-chain confirmation:

Step 7: View Updated Allocation

After confirmation, the allocation is updated:

Step 8: Track Earnings Over Time

Get historical earnings data:

Step 9: Unwind Position

When the user wants to withdraw:

Complete Service Example

Here’s a complete yield service wrapping all operations:

Next Steps

Full Walkthrough

Complete integration walkthrough

TypeScript Reference

Complete type definitions