Skip to main content
This guide walks through a complete RebelFi integration — from setup through yield generation and withdrawal. Every step includes working code. The same flow applies whether you’re building for an exchange, neobank, payment processor, or any other use case.

Prerequisites

1

Create a Wallet Profile

Go to Settings → Wallet Profiles in the dashboard. Create a profile with the blockchains you need enabled. See Wallet Profiles for details.
2

Generate an API Key

Go to Settings → API Keys. Generate a key and attach it to your Wallet Profile. Copy the key immediately — it’s shown only once.
3

Install the SDK

1. Register a Wallet

Register the wallet you want to deploy funds from. This is idempotent — calling it again with the same address returns the existing wallet.
The optional userId field links this wallet to your internal user. You can later query allocations and earnings by userId instead of wallet address.

Update metadata

Attach arbitrary metadata to a wallet:

List wallets

Query wallets for a user or by blockchain:

2. Discover Venues and Strategies

Find available yield opportunities:
Pick a strategy to use:

3. Check Pre-Supply Allocations

Before supplying, verify the user’s current positions:

4. Supply Flow

Create the operation

Operations expire after a short window. Sign and submit promptly.

Sign the transaction

The operation contains an unsigned transaction. Have the user sign it:

Broadcast and submit hash

Option A — You broadcast:
Option B — RebelFi broadcasts:

Poll for confirmation

5. Identifier Equivalence

After supply, you can query allocations and earnings using any wallet identifier — they all return the same data:
The same applies to the get and earnings methods. Use whichever identifier is most convenient.

6. Monitor Yield

Check allocations

Get earnings history

7. Unwind (Withdraw)

When the user wants to withdraw, create an unwind operation:

8. Cancel Flow

Cancel a pending operation that hasn’t been submitted:
You rarely need to cancel manually. Creating a new operation for the same wallet automatically cancels any pending ones.

9. Error Handling

See the Error Handling guide for comprehensive patterns including retry logic.

Next Steps

Error Handling

Comprehensive error handling patterns

TypeScript Reference

Complete type definitions