Skip to main content
Current Status: Yield metrics APIs are planned for Q1 2025 but not yet available with API key authentication.
  • Service methods exist internally
  • Dashboard displays these metrics
  • API endpoints need API key authentication support
Workaround: Use the RebelFi dashboard to view yield metrics until API endpoints are available.
These endpoints will enable you to prove ROI to stakeholders by answering: “How much money did RebelFi make me?”

Planned Endpoints

GET /api/token-positions/op-wallet/:id

Get token positions for an operational wallet with complete yield breakdown. Status: 🔜 Service exists, API endpoint with API key auth coming soon Headers:
X-API-Key: rfk_live_xxxxxxxxxxxxx
URL Parameters:
  • id - Operational wallet ID (opWalletId)
Planned Response:
[
  {
    "opWallet": {
      "id": 123,
      "address": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
      "blockchain": "SOLANA"
    },
    "token": {
      "symbol": "USDC",
      "name": "USD Coin",
      "decimals": 6,
      "mintAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
    },
    "balances": {
      "total": {
        "amount": "1.11",
        "currency": "USDC"
      },
      "available": {
        "amount": "0.11",
        "currency": "USDC"
      },
      "allocated": {
        "amount": "1.00",
        "currency": "USDC"
      },
      "principal": {
        "amount": "1.10",
        "currency": "USDC"
      },
      "yield": {
        "amount": "0.01",
        "currency": "USDC"
      }
    },
    "performance": {
      "currentAPY": "6.0",
      "lifetimeYield": {
        "amount": "0.01",
        "currency": "USDC"
      }
    },
    "timestamps": {
      "lastUpdated": {
        "iso": "2025-01-30T10:30:00Z",
        "unix": 1706611800
      },
      "inceptionDate": {
        "iso": "2025-01-15T08:00:00Z",
        "unix": 1705305600
      }
    }
  }
]
Key Fields:
  • balances.principal - Original funds deployed (total - yield)
  • balances.yield - Cumulative yield earned
  • performance.currentAPY - Current annual percentage yield (percentage string, e.g., “6.0” for 6%)
  • performance.lifetimeYield - Total yield earned since inception
  • timestamps.inceptionDate - When yield tracking started
Principal Calculation: principal = total balance - cumulative yieldThis comes from AllocationYieldSnapshot records that track yield accrual over time.

GET /api/v1/allocations (Enhanced)

List allocations with complete yield metrics. Status: ⚠️ Endpoint exists but requires JWT authentication. API key support + yield enhancements coming soon. Current Authentication: Authorization: Bearer (JWT only) Planned: X-API-Key header support Query Parameters:
  • opWalletId (optional) - Filter by operational wallet
  • token (optional) - Token symbol (e.g., “USDC”)
  • status (optional) - Filter by status (ACTIVE, UNWINDING, CLOSED)
  • limit (optional) - Items per page (default: 50)
  • offset (optional) - Starting position (default: 0)
Planned Enhanced Response:
{
  "allocations": [
    {
      "id": 456,
      "opWallet": {
        "id": 123,
        "address": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"
      },
      "token": {
        "symbol": "USDC",
        "decimals": 6,
        "mintAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
      },
      "venue": {
        "name": "Drift Protocol",
        "protocol": "DRIFT"
      },
      "balances": {
        "allocated": {
          "amount": "1.00",
          "currency": "USDC"
        },
        "principal": {
          "amount": "0.99",
          "currency": "USDC"
        },
        "yield": {
          "amount": "0.01",
          "currency": "USDC"
        }
      },
      "performance": {
        "currentApy": "6.0",
        "averageApy": "6.0",
        "lifetimeYield": {
          "amount": "0.01",
          "currency": "USDC"
        }
      },
      "timestamps": {
        "createdAt": {
          "iso": "2025-01-15T08:00:00Z",
          "unix": 1705305600
        },
        "lastUpdated": {
          "iso": "2025-01-30T10:30:00Z",
          "unix": 1706611800
        }
      },
      "status": "ACTIVE"
    }
  ],
  "pagination": {
    "total": 1,
    "limit": 50,
    "offset": 0,
    "hasMore": false
  }
}
New Fields (Planned):
  • balances.principal - Original amount deployed
  • balances.yield - Yield earned on this allocation
  • performance.currentApy - Current APY for this allocation
  • performance.lifetimeYield - Total yield earned

GET /api/wallets/stats (Enhanced)

Get wallet-level or org-level performance metrics. Status: ⚠️ Endpoint exists but needs yield metrics enhancement Headers:
X-API-Key: rfk_live_xxxxxxxxxxxxx (Planned)
Authorization: Bearer YOUR_JWT_TOKEN (Current)
Query Parameters:
  • opWalletId (optional) - Specific wallet (omit for org-level)
Planned Enhanced Response:
{
  "opWallet": {
    "id": 123,
    "address": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
    "blockchain": "SOLANA"
  },
  "organization": {
    "id": 1,
    "name": "Your Organization"
  },
  "balances": {
    "totalUsd": "3.61",
    "availableUsd": "0.61",
    "allocatedUsd": "3.00",
    "byToken": [
      {
        "currency": "USDC",
        "total": "1.11",
        "available": "0.11",
        "allocated": "1.00"
      },
      {
        "currency": "USDT",
        "total": "2.50",
        "available": "0.50",
        "allocated": "2.00"
      }
    ]
  },
  "performance": {
    "totalPrincipalUsd": "3.50",
    "totalYieldUsd": "0.11",
    "lifetimeROI": "3.14",
    "weightedAvgAPY": "5.83",
    "byToken": [
      {
        "currency": "USDC",
        "principal": "1.10",
        "yield": "0.01",
        "apy": "6.0"
      },
      {
        "currency": "USDT",
        "principal": "2.40",
        "yield": "0.10",
        "apy": "5.75"
      }
    ]
  },
  "allocations": {
    "activeCount": 3,
    "totalUsd": "3.00",
    "byProvider": [
      {
        "provider": {
          "name": "Drift Protocol",
          "protocol": "DRIFT"
        },
        "totalUsd": "2.00",
        "apy": "5.88",
        "byToken": [
          {
            "currency": "USDC",
            "allocated": "1.00",
            "apy": "6.0"
          },
          {
            "currency": "USDT",
            "allocated": "1.00",
            "apy": "5.75"
          }
        ]
      },
      {
        "provider": {
          "name": "Kamino",
          "protocol": "KAMINO"
        },
        "totalUsd": "1.00",
        "apy": "5.7",
        "byToken": [
          {
            "currency": "USDT",
            "allocated": "1.00",
            "apy": "5.7"
          }
        ]
      }
    ]
  },
  "timestamps": {
    "inceptionDate": {
      "iso": "2025-01-15T08:00:00Z",
      "unix": 1705305600
    },
    "lastActivity": {
      "iso": "2025-01-30T10:30:00Z",
      "unix": 1706611800
    }
  }
}
Key Metrics:
  • performance.totalPrincipalUsd - Original funds deployed (across all tokens)
  • performance.totalYieldUsd - Total yield earned
  • performance.lifetimeROI - Percentage return (yield / principal)
  • performance.weightedAvgAPY - Weighted average APY across all allocations
  • allocations.byProvider - Performance breakdown by yield protocol
USD Aggregation: All USD totals assume stablecoins = $1.00 USD. Non-stablecoin support (with price oracle) coming in future.

GET /api/core/operations/:id (Enhanced)

Get operation details with blockchain transactions and yield metrics for completed allocations. Status: 🔜 Endpoint planned, service method exists Headers:
X-API-Key: rfk_live_xxxxxxxxxxxxx (Planned)
Authorization: Bearer YOUR_JWT_TOKEN (Current)
Planned Response:
{
  "id": 789,
  "type": "SUPPLY",
  "status": "COMPLETED",
  "opWallet": {
    "id": 123,
    "address": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
    "blockchain": "SOLANA"
  },
  "token": {
    "symbol": "USDC",
    "decimals": 6,
    "mintAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
  },
  "amount": {
    "amount": "1.00",
    "currency": "USDC"
  },
  "blockchainTransactions": [
    {
      "id": 2001,
      "txHash": "5K7Wv8X9YbN3cPdQ6tRzH4mEfJsL2kUiG1nVpWqXoAy",
      "type": "SUPPLY",
      "status": "CONFIRMED",
      "amount": {
        "amount": "1.00",
        "currency": "USDC"
      },
      "timestamps": {
        "detectedAt": {
          "iso": "2025-01-30T10:25:00Z",
          "unix": 1706611500
        },
        "confirmedAt": {
          "iso": "2025-01-30T10:26:00Z",
          "unix": 1706611560
        }
      }
    }
  ],
  "yieldMetrics": {
    "principalDeployed": {
      "amount": "1.00",
      "currency": "USDC"
    },
    "yieldEarned": {
      "amount": "0.01",
      "currency": "USDC"
    },
    "effectiveAPY": "6.0",
    "daysAllocated": 15
  },
  "timestamps": {
    "createdAt": {
      "iso": "2025-01-30T10:20:00Z",
      "unix": 1706611200
    },
    "completedAt": {
      "iso": "2025-01-30T10:26:00Z",
      "unix": 1706611560
    }
  }
}
Yield Metrics (for completed SUPPLY operations):
  • yieldMetrics.principalDeployed - Original amount allocated
  • yieldMetrics.yieldEarned - Yield earned during allocation period
  • yieldMetrics.effectiveAPY - APY achieved during this allocation
  • yieldMetrics.daysAllocated - How long funds were deployed

Use Cases

Prove ROI to Stakeholders

// Get wallet performance metrics
const stats = await fetch('/api/wallets/stats?opWalletId=123', {
  headers: { 'X-API-Key': process.env.REBELFI_API_KEY }
}).then(r => r.json());

// Show stakeholders
console.log(`Total Deployed: $${stats.balances.allocatedUsd} USD`);
console.log(`Total Yield Earned: $${stats.performance.totalYieldUsd} USD`);
console.log(`Lifetime ROI: ${stats.performance.lifetimeROI}%`);
console.log(`Average APY: ${stats.performance.weightedAvgAPY}%`);

// Generate monthly report
stats.performance.byToken.forEach(token => {
  console.log(`${token.currency}: ${token.yield} yield (${token.apy}% APY)`);
});

Track Individual Allocation Performance

// Get allocations with yield breakdown
const allocations = await fetch('/api/v1/allocations?opWalletId=123', {
  headers: { 'X-API-Key': process.env.REBELFI_API_KEY }
}).then(r => r.json());

allocations.allocations.forEach(allocation => {
  console.log(`Protocol: ${allocation.venue.name}`);
  console.log(`  Principal: ${allocation.balances.principal.amount} ${allocation.balances.principal.currency}`);
  console.log(`  Yield: ${allocation.balances.yield.amount} ${allocation.balances.yield.currency}`);
  console.log(`  Current APY: ${allocation.performance.currentApy}%`);
});

Monitor Wallet Performance

// Get token positions with yield
const positions = await fetch('/api/token-positions/op-wallet/123', {
  headers: { 'X-API-Key': process.env.REBELFI_API_KEY }
}).then(r => r.json());

positions.forEach(position => {
  const roi = (parseFloat(position.balances.yield.amount) /
               parseFloat(position.balances.principal.amount) * 100);

  console.log(`${position.token.symbol}:`);
  console.log(`  Total: ${position.balances.total.amount}`);
  console.log(`  Principal: ${position.balances.principal.amount}`);
  console.log(`  Yield: ${position.balances.yield.amount}`);
  console.log(`  ROI: ${roi.toFixed(2)}%`);
  console.log(`  Current APY: ${position.performance.currentAPY}%`);
});

Data Types

All yield metrics endpoints use standard data types:
  • Amount: See Data Types Reference - 2-field { amount, currency } format
  • APY: Simple percentage string (e.g., “6.0” for 6% APY)
  • USD Aggregate: Simple string (e.g., “3.61” for $3.61 USD)
  • Timestamp: See Data Types Reference
For complete details, see Data Types Reference.

Current Workaround

Until API endpoints are available:
  1. Use the Dashboard: Navigate to Wallets → [Your Wallet] to view:
    • Principal vs yield breakdown
    • Current APY per allocation
    • Lifetime yield earned
    • Performance by protocol
  2. Export Data: Dashboard supports CSV export for offline analysis
  3. Contact Support: For programmatic access needs, contact support@rebelfi.io to discuss early access

Timeline

Q1 2025 Roadmap:
  • ✅ Service methods implemented
  • ✅ Dashboard displays yield metrics
  • 🔜 API key authentication support for existing endpoints
  • 🔜 Enhanced response formats with yield breakdown
  • 🔜 New endpoints for token positions and operation details
What’s Being Built:
  1. Add API key authentication to existing endpoints
  2. Enhance allocation responses with yield metrics
  3. Create token position endpoint with yield breakdown
  4. Create operation details endpoint
  5. Add wallet stats yield performance section


Support

Questions about yield metrics or timeline?