Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rebelfi.io/docs/llms.txt

Use this file to discover all available pages before exploring further.

AllocationsAPI

Access via client.allocations.

list

List all allocations for a wallet. Accepts walletId, walletAddress, or userId.
async list(query: AllocationListRequest | AllocationQuery): Promise<AllocationListResponse>
interface AllocationListRequest {
  /** Wallet address */
  walletAddress?: string;
  /** Wallet ID from registration */
  walletId?: number;
  /** External user ID */
  userId?: string;
  /** Filter by blockchain */
  blockchain?: 'solana' | 'polygon' | 'ethereum' | 'base';
}

interface AllocationListResponse {
  allocations: Allocation[];
  totalValue: string;
  totalYieldEarned: string;
}

get

Get allocation by strategy ID. Pass wallet address (string) or wallet ID (number).
async get(strategyId: number, wallet: string | number): Promise<Allocation>

earnings

Get historical earnings data. Identify the wallet with walletAddress, walletId, or userId.
async earnings(query: EarningsQuery): Promise<EarningsResponse>
interface EarningsQuery {
  walletAddress?: string;
  walletId?: number;
  userId?: string;
  blockchain: 'solana' | 'polygon' | 'ethereum' | 'base';
  token: string;
  days?: number;
  includeBreakdown?: boolean;
}

interface EarningsResponse {
  walletAddress: string;
  blockchain: string;
  token: string;
  periodStart: string;
  periodEnd: string;
  firstActivityDate: string | null;
  totalYieldEarned: string;
  totalYieldEarnedUsd: string;
  history: EarningsDay[];
  byVenue?: VenueEarnings[];
}

interface EarningsDay {
  date: string;
  yieldEarned: string;
  yieldEarnedUsd: string;
  cumulativeYield: string;
  positionValue: string;
}

interface VenueEarnings {
  venueId: number;
  venueName: string;
  totalYieldEarned: string;
  totalYieldEarnedUsd: string;
  history: { date: string; yieldEarned: string; yieldEarnedUsd: string }[];
}

overview

Get org-level overview of all wallet allocations. Returns aggregate metrics scoped to the wallet profile associated with your API key.
async overview(): Promise<OrgOverview>
interface OrgOverview {
  /** Wallet profile ID */
  walletProfileId: number;
  /** Wallet profile name */
  walletProfileName: string;
  /** Total number of wallets */
  totalWallets: number;
  /** Wallets with active allocations */
  activeWallets: number;
  /** Total value across all wallets (USD) */
  totalValueUsd: string;
  /** Total yield earned across all wallets (USD) */
  totalYieldEarnedUsd: string;
  /** Weighted average APY as decimal (e.g., 0.065 for 6.5%) */
  averageApyDecimal: number;
  /** Breakdown by protocol */
  protocolDistribution: DistributionEntry[];
  /** Breakdown by token */
  assetDistribution: DistributionEntry[];
  /** Breakdown by blockchain */
  blockchainDistribution: DistributionEntry[];
}

interface DistributionEntry {
  /** Protocol name, token symbol, or blockchain name */
  name: string;
  /** Total value in USD */
  valueUsd: string;
  /** Percentage of total value (0-100) */
  percentage: number;
  /** Number of wallets in this category */
  walletCount: number;
}

overviewAll

Get aggregate overview across all wallet profiles. Requires an admin API key. Optionally filter to a specific profile by passing walletProfileId.
async overviewAll(walletProfileId?: number): Promise<OrgOverviewAll>
interface OrgOverviewAll {
  /** Per-profile overview breakdown */
  profiles: OrgOverview[];
  /** Aggregated totals across all profiles */
  totals: OrgOverviewTotals;
}

interface OrgOverviewTotals {
  totalWallets: number;
  activeWallets: number;
  totalValueUsd: string;
  totalYieldEarnedUsd: string;
  averageApyDecimal: number;
  protocolDistribution: DistributionEntry[];
  assetDistribution: DistributionEntry[];
  blockchainDistribution: DistributionEntry[];
}

Allocation Type

interface Allocation {
  strategyId: number;
  strategyName: string;
  venueId: number;
  venueName: string;
  walletAddress: string;
  blockchain: 'solana' | 'polygon' | 'ethereum' | 'base';
  token: string;
  tokenAddress: string;
  principal: string;
  currentValue: string;
  yieldEarned: string;
  apy: number;
  lastUpdated: string;
}