Skip to main content

Allocations Endpoints

Manage yield allocations and portfolio tracking.

GET /api/v1/allocations

List all active allocations and get portfolio summary. Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Query Parameters:
  • status (optional) - Filter by status: ACTIVE, UNWINDING, CLOSED
Response:
{
  "allocations": [
    {
      "id": 1001,
      "managedWalletId": 456,
      "token": "USDC",
      "allocatedBase": "10000.00",
      "currentValue": "10324.17",
      "yieldEarned": "324.17",
      "status": "ACTIVE",
      "protocol": "Drift Protocol",
      "apy": "6.5%",
      "createdAt": "2025-10-15T10:00:00Z",
      "lastUpdatedAt": "2025-10-23T14:00:00Z"
    }
  ],
  "portfolioSummary": {
    "totalDeployed": "175000.00",
    "totalValue": "179432.15",
    "totalYieldEarned": "4432.15",
    "averageAPY": "6.3%",
    "activeAllocations": 12
  }
}

GET /api/v1/allocations/:id

Get detailed information for a specific allocation. Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Response:
{
  "id": 1001,
  "managedWalletId": 456,
  "wallet": {
    "id": 456,
    "address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "blockchain": "solana"
  },
  "token": "USDC",
  "allocatedBase": "10000.00",
  "currentValue": "10324.17",
  "yieldEarned": "324.17",
  "status": "ACTIVE",
  "protocol": "Drift Protocol",
  "apy": "6.5%",
  "performance": {
    "dailyYield": "1.78",
    "weeklyYield": "12.46",
    "monthlyYield": "53.42"
  },
  "createdAt": "2025-10-15T10:00:00Z",
  "lastUpdatedAt": "2025-10-23T14:00:00Z"
}

POST /api/v1/allocations

Create a supply operation to deploy funds to yield. Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Request Body:
{
  "managedWalletId": 456,
  "amount": "10000.00",
  "asset": "USDC"
}
Response:
{
  "success": true,
  "reservationId": 2001,
  "reservedAmount": "10000.00",
  "shortfall": "0.00",
  "bundleId": 3001
}
This endpoint creates a reservation and queues a supply operation. The actual deployment happens when your custody agent picks up and executes the transaction.
Error Responses: Insufficient balance:
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "message": "Available balance is less than requested amount",
    "details": {
      "available": "5000.00",
      "requested": "10000.00",
      "shortfall": "5000.00"
    }
  }
}

Allocation States

Allocation is deployed and earning yield. This is the normal operating state.
Allocation is being withdrawn. Funds are in the process of returning to the wallet.
Allocation has been fully withdrawn and is no longer active.

Example Usage

// List all allocations
const response = await fetch('https://api.rebelfi.io/api/v1/allocations', {
  headers: { 'Authorization': `Bearer ${accessToken}` }
});

const { allocations, portfolioSummary } = await response.json();
console.log('Total deployed:', portfolioSummary.totalDeployed);
console.log('Total yield earned:', portfolioSummary.totalYieldEarned);

// Create a supply operation
const supplyResponse = await fetch('https://api.rebelfi.io/api/v1/allocations', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${accessToken}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    managedWalletId: 456,
    amount: '10000.00',
    asset: 'USDC'
  })
});

const result = await supplyResponse.json();
console.log('Reservation created:', result.reservationId);
console.log('Operation ID:', result.bundleId);

// Get specific allocation details
const allocationResponse = await fetch('https://api.rebelfi.io/api/v1/allocations/1001', {
  headers: { 'Authorization': `Bearer ${accessToken}` }
});

const allocation = await allocationResponse.json();
console.log('Current yield:', allocation.yieldEarned);

Portfolio Management

Diversification

Allocations are automatically diversified across protocols based on:
  • Protocol TVL and security
  • Historical APY and stability
  • Available liquidity
  • Risk-adjusted returns

Performance Tracking

Monitor allocation performance:
// Get portfolio summary
const { portfolioSummary } = await fetch('https://api.rebelfi.io/api/v1/allocations').then(r => r.json());

console.log('Average APY:', portfolioSummary.averageAPY);
console.log('Total yield earned:', portfolioSummary.totalYieldEarned);

// Calculate yield rate
const yieldRate = (portfolioSummary.totalYieldEarned / portfolioSummary.totalDeployed) * 100;
console.log('Realized yield rate:', yieldRate.toFixed(2) + '%');

Rebalancing

Automatic rebalancing based on:
  • Protocol performance changes
  • APY fluctuations
  • Risk score updates
  • Capacity constraints

Withdrawal Process

To withdraw funds from allocations:
  1. Create disburse operation - Use dedicated endpoint or adjust buffer amount
  2. System unwinds allocation - Exits yield position
  3. Funds return to wallet - Available balance increases
  4. Allocation marked CLOSED - No longer earning yield
Lowering the buffer amount triggers automatic unwinding. Contact us for dedicated withdrawal endpoint access.

Best Practices

Check allocations daily to track performance and ensure yields meet expectations.
Don’t deploy all funds at once. Stagger deployments to optimize entry timing and reduce risk.
Always keep sufficient buffer for operational needs. Don’t over-optimize for yield at the expense of liquidity.

Rate Limits

Creation endpoints are rate limited:
  • POST /api/v1/allocations: 10 requests per minute
List endpoints have standard rate limits:
  • GET /api/v1/allocations: 100 requests per minute