Skip to main content

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';
}

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';
  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 }[];
}

Allocation Type

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