Skip to main content

Prerequisites

  • Node.js 18+ or Bun
  • A RebelFi API key (get one here)
  • A wallet for testing (Ethereum, Polygon, Base, or Solana)

Installation

Initialize the Client

Store your API key securely. Never commit it to version control or expose it in client-side code. See the Sandbox guide for testing setup.

Register a Wallet

Before supplying, register the user’s wallet:
Registration is idempotent — calling it again returns the existing wallet.

List Available Venues

Query available yield venues and their strategies:
Example output:

Plan a Supply Operation

Select a strategy and plan a supply operation:
Operations expire after a short time (typically 5 minutes). Make sure to sign and submit promptly.

Sign and Submit

After the user signs the transaction:

Check Operation Status

Poll for confirmation:

View Allocations

After supply is confirmed, check the allocation:

Complete Example

Next Steps

Full Walkthrough

Complete integration walkthrough

Error Handling

Handle errors gracefully