Get Earnings
curl --request GET \
--url https://api.example.com/v1/allocations/earningsimport requests
url = "https://api.example.com/v1/allocations/earnings"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/allocations/earnings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/allocations/earnings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/allocations/earnings"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/allocations/earnings")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/allocations/earnings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyAllocations
Get Earnings
GET /v1/allocations/earnings — Get daily earnings history
GET
/
v1
/
allocations
/
earnings
Get Earnings
curl --request GET \
--url https://api.example.com/v1/allocations/earningsimport requests
url = "https://api.example.com/v1/allocations/earnings"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/allocations/earnings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/allocations/earnings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/allocations/earnings"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/allocations/earnings")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/allocations/earnings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyEndpoint:
GET https://api.rebelfi.io/v1/allocations/earningsQuery Parameters
Provide exactly one wallet identifier, plus required filters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
walletAddress | string | One of | - | Wallet address |
walletId | number | One of | - | Wallet ID |
userId | string | One of | - | External user ID |
blockchain | string | Yes | - | Blockchain: solana, polygon, ethereum, or base |
token | string | Yes | - | Token symbol (e.g., USDC) |
days | number | No | 30 | Days of history (max 90) |
includeBreakdown | boolean | No | false | Include per-venue breakdown |
Example Request
curl -X GET "https://api.rebelfi.io/v1/allocations/earnings?walletId=42&blockchain=ethereum&token=USDC&days=30&includeBreakdown=true" \
-H "x-api-key: your_api_key"
const earnings = await client.allocations.earnings({
walletId: 42,
blockchain: 'ethereum', // or 'polygon', 'base', 'solana'
token: 'USDC',
days: 30,
includeBreakdown: true
});
Example Response
{
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
"blockchain": "ethereum",
"token": "USDC",
"periodStart": "2024-01-01",
"periodEnd": "2024-01-15",
"firstActivityDate": "2024-01-05",
"totalYieldEarned": "8500000",
"totalYieldEarnedUsd": "8.500000",
"history": [
{
"date": "2024-01-05",
"yieldEarned": "0",
"yieldEarnedUsd": "0.000000",
"cumulativeYield": "0",
"positionValue": "1000000000"
},
{
"date": "2024-01-06",
"yieldEarned": "850000",
"yieldEarnedUsd": "0.850000",
"cumulativeYield": "850000",
"positionValue": "1000850000"
}
],
"byVenue": [
{
"venueId": 3,
"venueName": "AAVE V3",
"totalYieldEarned": "8500000",
"totalYieldEarnedUsd": "8.500000",
"history": [
{
"date": "2024-01-06",
"yieldEarned": "850000",
"yieldEarnedUsd": "0.850000"
}
]
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
walletAddress | string | Queried wallet address |
blockchain | string | Blockchain network |
token | string | Token symbol |
periodStart | string | Start of period (YYYY-MM-DD) |
periodEnd | string | End of period (YYYY-MM-DD) |
firstActivityDate | string? | First date with data (null if never active) |
totalYieldEarned | string | Total yield in period (base units) |
totalYieldEarnedUsd | string | Total yield in USD |
history | EarningsDay[] | Daily earnings (sparse — only dates with data) |
byVenue | VenueEarnings[]? | Per-venue breakdown (if requested) |
EarningsDay Object
| Field | Type | Description |
|---|---|---|
date | string | Date (YYYY-MM-DD) |
yieldEarned | string | Yield earned that day, before yield share (base units, can be negative) |
yieldEarnedUsd | string | Yield in USD |
cumulativeYield | string | Cumulative yield from the start of the requested period, before yield share (base units) |
positionValue | string | Position value at end of day, before yield share (base units) |
The
history array is sparse. A day is missing when the wallet had no active position that day; it has no entry, rather than an entry with zero yield. The day a position is first opened also has no entry; its yield is counted on the next day.Days are UTC calendar days and close at 00:00 UTC. The most recent entry is the previous day; the current day is not included.
Daily yield is the change in position value minus the change in principal. If funds move in or out of the wallet’s position outside RebelFi, that amount appears as yield or loss on that day.