Skip to main content

What is RebelFi SDK?

The RebelFi SDK is a TypeScript library that enables platforms to generate 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
Full custody is maintained throughout the entire process — funds never leave your wallets.

Key Concepts

Venues

A venue represents a DeFi protocol that offers yield opportunities. Examples include AAVE and Morpho (Ethereum/Polygon), Kamino and Drift (Solana), and other lending/yield protocols.
const { venues } = await client.venues.list();

// Example venue (EVM)
{
  id: 3,
  name: 'AAVE V3',
  protocol: 'aave-v3',
  blockchain: 'ethereum',
  status: 'active',
  strategies: [...]
}

// Example venue (Solana)
{
  id: 1,
  name: 'Kamino',
  protocol: 'kamino',
  blockchain: 'solana',
  status: 'active',
  strategies: [...]
}

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
// Strategies are nested within venues
const strategy = venues[0].strategies[0];

// Example strategy (Ethereum)
{
  strategyId: 5,
  name: 'USDC Lending',
  token: 'USDC',
  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  apy: 0.052,  // 5.2%
  status: 'active'
}

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
const { allocations } = await client.allocations.list({
  walletAddress: userWallet
});

// Example allocation (Ethereum)
{
  strategyId: 5,
  strategyName: 'USDC Lending',
  venueName: 'AAVE V3',
  walletAddress: '0x742d...bD18',
  principal: '5000000000',      // 5000 USDC deposited
  currentValue: '5026000000',   // 5026 USDC current value
  yieldEarned: '26000000',      // 26 USDC earned
  apy: 0.052
}

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.
const operation = await client.operations.supply({
  walletAddress: userWallet,
  strategyId: 5,
  amount: '1000000000',
  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
});

// Example operation response
{
  operationId: 123,
  type: 'supply',
  status: 'AWAITING_SIGNATURE',
  transactions: [{
    id: 456,
    status: 'unsigned',
    unsignedTransaction: 'f86c...hex...',
    description: 'Supply USDC to AAVE V3'
  }],
  expiresAt: '2024-01-15T12:30:00Z'
}

Transactions

A transaction is a blockchain transaction within an operation. Transactions go through these states:
unsigned → pending → confirmed
                  ↘ failed
  • 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:
FeatureSDKDirect API
Type safetyFull TypeScript typesNone
Error handlingRebelfiError classRaw HTTP errors
AuthenticationAutomatic header injectionManual
Response parsingAutomaticManual
Use the SDK for TypeScript/JavaScript applications. Use the API directly for other languages or when you need maximum control.

Wallet Identifiers

The SDK accepts multiple wallet identifiers interchangeably:
  • walletAddress — the on-chain address (recommended)
  • walletId — RebelFi’s internal numeric ID (returned from wallet registration)
  • userId — your application’s user identifier (if set during registration)
All examples in this documentation use walletAddress. You can substitute walletId or userId anywhere a wallet identifier is accepted.

Supported Blockchains

BlockchainToken SupportStatus
SolanaUSDC, USDTLive
PolygonUSDC, USDTLive
EthereumUSDC, USDTLive
BaseUSDC, USDTComing Soon
ArbitrumUSDC, USDTComing Soon

Next Steps