What is RebelFi SDK?
The RebelFi SDK is a TypeScript library that enables applications to offer yield on stablecoin balances. It provides a simple interface for:- Discovering yield venues and strategies
- Planning supply and unwind operations
- Tracking allocations and earnings
- Managing transaction submission
Key Concepts
Venues
A venue represents a DeFi protocol that offers yield opportunities. Examples include Kamino, Drift, and other lending/yield protocols.Strategies
A strategy is a specific yield opportunity within a venue. Each strategy has:- A supported token (e.g., USDC)
- Current APY
- Minimum/maximum deposit limits
Allocations
An allocation represents a user’s position in a strategy. It tracks:- Principal (original amount deposited)
- Current value (including accrued yield)
- Total yield earned
Operations
An operation is a business action like supplying funds to a strategy or unwinding a position. Operations contain one or more transactions that need to be signed.Transactions
A transaction is a blockchain transaction within an operation. Transactions go through these states:- unsigned: Transaction built, waiting for user signature
- pending: Signed and broadcast, waiting for confirmation
- confirmed: Successfully confirmed on-chain
- failed: Transaction failed (reverted, timeout, etc.)
SDK vs Direct API
The SDK is a thin wrapper around the REST API with added benefits:| Feature | SDK | Direct API |
|---|---|---|
| Type safety | Full TypeScript types | None |
| Error handling | RebelfiError class | Raw HTTP errors |
| Authentication | Automatic header injection | Manual |
| Response parsing | Automatic | Manual |
Supported Blockchains
| Blockchain | Status | Tokens |
|---|---|---|
| Solana | Available | USDC |
| Polygon | Coming Soon | - |
| Ethereum | Planned | - |