YieldGetAggregateBalances returns balances across multiple yields and networks.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances \
--header 'Content-Type: application/json' \
--data '
{
"queries": [
{
"address": "<string>",
"network": "<string>",
"yieldId": "<string>",
"arguments": {
"cAddressBech": "<string>",
"pAddressBech": "<string>",
"autoSweepDayOfMonth": 123,
"autoSweepTimezone": "<string>"
}
}
]
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances"
payload = { "queries": [
{
"address": "<string>",
"network": "<string>",
"yieldId": "<string>",
"arguments": {
"cAddressBech": "<string>",
"pAddressBech": "<string>",
"autoSweepDayOfMonth": 123,
"autoSweepTimezone": "<string>"
}
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
queries: [
{
address: '<string>',
network: '<string>',
yieldId: '<string>',
arguments: {
cAddressBech: '<string>',
pAddressBech: '<string>',
autoSweepDayOfMonth: 123,
autoSweepTimezone: '<string>'
}
}
]
})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances', 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://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'queries' => [
[
'address' => '<string>',
'network' => '<string>',
'yieldId' => '<string>',
'arguments' => [
'cAddressBech' => '<string>',
'pAddressBech' => '<string>',
'autoSweepDayOfMonth' => 123,
'autoSweepTimezone' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances"
payload := strings.NewReader("{\n \"queries\": [\n {\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"yieldId\": \"<string>\",\n \"arguments\": {\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"autoSweepDayOfMonth\": 123,\n \"autoSweepTimezone\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances")
.header("Content-Type", "application/json")
.body("{\n \"queries\": [\n {\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"yieldId\": \"<string>\",\n \"arguments\": {\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"autoSweepDayOfMonth\": 123,\n \"autoSweepTimezone\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"queries\": [\n {\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"yieldId\": \"<string>\",\n \"arguments\": {\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"autoSweepDayOfMonth\": 123,\n \"autoSweepTimezone\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"yieldId": "<string>",
"balances": [
{
"address": "<string>",
"type": "<string>",
"amount": "<string>",
"amountRaw": "<string>",
"pendingActions": [
{
"intent": "<string>",
"type": "<string>",
"passthrough": "<string>",
"arguments": {
"fields": [
{
"name": "<string>",
"type": "<string>",
"label": "<string>",
"description": "<string>",
"required": true,
"options": [
"<string>"
],
"optionsRef": "<string>",
"default": {},
"placeholder": "<string>",
"minimum": "<string>",
"maximum": "<string>",
"isArray": true
}
],
"notes": "<string>"
},
"amount": "<string>"
}
],
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"isEarning": true,
"date": "<string>",
"feeConfigurationId": "<string>",
"validator": {
"address": "<string>",
"name": "<string>",
"logoURI": "<string>",
"website": "<string>",
"rewardRate": {
"total": 123,
"rateType": "<string>",
"components": [
{
"rate": 123,
"rateType": "<string>",
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"yieldSource": "<string>",
"description": "<string>"
}
]
},
"provider": {
"name": "<string>",
"id": "<string>",
"logoURI": "<string>",
"description": "<string>",
"website": "<string>",
"tvlUsd": {},
"type": "<string>",
"rank": 123,
"preferred": true,
"references": [
"<string>"
],
"revshare": {
"trial": {
"minRevShare": 123,
"maxRevShare": 123
},
"standard": {
"minRevShare": 123,
"maxRevShare": 123
},
"pro": {
"minRevShare": 123,
"maxRevShare": 123
}
},
"uniqueId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"commission": 123,
"tvlUsd": "<string>",
"tvl": "<string>",
"tvlRaw": "<string>",
"votingPower": 123,
"preferred": true,
"minimumStake": "<string>",
"remainingPossibleStake": "<string>",
"remainingSlots": 123,
"nominatorCount": 123,
"status": "<string>",
"providerId": "<string>",
"pricePerShare": "<string>",
"subnetId": 123,
"subnetName": "<string>",
"marketCap": "<string>",
"tokenSymbol": "<string>"
},
"validators": [
{
"address": "<string>",
"name": "<string>",
"logoURI": "<string>",
"website": "<string>",
"rewardRate": {
"total": 123,
"rateType": "<string>",
"components": [
{
"rate": 123,
"rateType": "<string>",
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"yieldSource": "<string>",
"description": "<string>"
}
]
},
"provider": {
"name": "<string>",
"id": "<string>",
"logoURI": "<string>",
"description": "<string>",
"website": "<string>",
"tvlUsd": {},
"type": "<string>",
"rank": 123,
"preferred": true,
"references": [
"<string>"
],
"revshare": {
"trial": {
"minRevShare": 123,
"maxRevShare": 123
},
"standard": {
"minRevShare": 123,
"maxRevShare": 123
},
"pro": {
"minRevShare": 123,
"maxRevShare": 123
}
},
"uniqueId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"commission": 123,
"tvlUsd": "<string>",
"tvl": "<string>",
"tvlRaw": "<string>",
"votingPower": 123,
"preferred": true,
"minimumStake": "<string>",
"remainingPossibleStake": "<string>",
"remainingSlots": 123,
"nominatorCount": 123,
"status": "<string>",
"providerId": "<string>",
"pricePerShare": "<string>",
"subnetId": 123,
"subnetName": "<string>",
"marketCap": "<string>",
"tokenSymbol": "<string>"
}
],
"amountUsd": "<string>",
"priceRange": {},
"tokenId": "<string>",
"shareAmount": "<string>",
"shareAmountRaw": "<string>",
"shareToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
}
}
],
"outputTokenBalance": {
"address": "<string>",
"type": "<string>",
"amount": "<string>",
"amountRaw": "<string>",
"pendingActions": [
{
"intent": "<string>",
"type": "<string>",
"passthrough": "<string>",
"arguments": {
"fields": [
{
"name": "<string>",
"type": "<string>",
"label": "<string>",
"description": "<string>",
"required": true,
"options": [
"<string>"
],
"optionsRef": "<string>",
"default": {},
"placeholder": "<string>",
"minimum": "<string>",
"maximum": "<string>",
"isArray": true
}
],
"notes": "<string>"
},
"amount": "<string>"
}
],
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"isEarning": true,
"date": "<string>",
"feeConfigurationId": "<string>",
"validator": {
"address": "<string>",
"name": "<string>",
"logoURI": "<string>",
"website": "<string>",
"rewardRate": {
"total": 123,
"rateType": "<string>",
"components": [
{
"rate": 123,
"rateType": "<string>",
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"yieldSource": "<string>",
"description": "<string>"
}
]
},
"provider": {
"name": "<string>",
"id": "<string>",
"logoURI": "<string>",
"description": "<string>",
"website": "<string>",
"tvlUsd": {},
"type": "<string>",
"rank": 123,
"preferred": true,
"references": [
"<string>"
],
"revshare": {
"trial": {
"minRevShare": 123,
"maxRevShare": 123
},
"standard": {
"minRevShare": 123,
"maxRevShare": 123
},
"pro": {
"minRevShare": 123,
"maxRevShare": 123
}
},
"uniqueId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"commission": 123,
"tvlUsd": "<string>",
"tvl": "<string>",
"tvlRaw": "<string>",
"votingPower": 123,
"preferred": true,
"minimumStake": "<string>",
"remainingPossibleStake": "<string>",
"remainingSlots": 123,
"nominatorCount": 123,
"status": "<string>",
"providerId": "<string>",
"pricePerShare": "<string>",
"subnetId": 123,
"subnetName": "<string>",
"marketCap": "<string>",
"tokenSymbol": "<string>"
},
"validators": [
{
"address": "<string>",
"name": "<string>",
"logoURI": "<string>",
"website": "<string>",
"rewardRate": {
"total": 123,
"rateType": "<string>",
"components": [
{
"rate": 123,
"rateType": "<string>",
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"yieldSource": "<string>",
"description": "<string>"
}
]
},
"provider": {
"name": "<string>",
"id": "<string>",
"logoURI": "<string>",
"description": "<string>",
"website": "<string>",
"tvlUsd": {},
"type": "<string>",
"rank": 123,
"preferred": true,
"references": [
"<string>"
],
"revshare": {
"trial": {
"minRevShare": 123,
"maxRevShare": 123
},
"standard": {
"minRevShare": 123,
"maxRevShare": 123
},
"pro": {
"minRevShare": 123,
"maxRevShare": 123
}
},
"uniqueId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"commission": 123,
"tvlUsd": "<string>",
"tvl": "<string>",
"tvlRaw": "<string>",
"votingPower": 123,
"preferred": true,
"minimumStake": "<string>",
"remainingPossibleStake": "<string>",
"remainingSlots": 123,
"nominatorCount": 123,
"status": "<string>",
"providerId": "<string>",
"pricePerShare": "<string>",
"subnetId": 123,
"subnetName": "<string>",
"marketCap": "<string>",
"tokenSymbol": "<string>"
}
],
"amountUsd": "<string>",
"priceRange": {},
"tokenId": "<string>",
"shareAmount": "<string>",
"shareAmountRaw": "<string>",
"shareToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
}
},
"rewardRate": {
"total": 123,
"rateType": "<string>",
"components": [
{
"rate": 123,
"rateType": "<string>",
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"yieldSource": "<string>",
"description": "<string>"
}
]
}
}
],
"errors": [
{
"yieldId": "<string>",
"error": "<string>"
}
]
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Earn
YieldGetAggregateBalances
Fetch a wallet’s earn balances across chains and yield positions
POST
/
rpc
/
Trails
/
YieldGetAggregateBalances
YieldGetAggregateBalances returns balances across multiple yields and networks.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances \
--header 'Content-Type: application/json' \
--data '
{
"queries": [
{
"address": "<string>",
"network": "<string>",
"yieldId": "<string>",
"arguments": {
"cAddressBech": "<string>",
"pAddressBech": "<string>",
"autoSweepDayOfMonth": 123,
"autoSweepTimezone": "<string>"
}
}
]
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances"
payload = { "queries": [
{
"address": "<string>",
"network": "<string>",
"yieldId": "<string>",
"arguments": {
"cAddressBech": "<string>",
"pAddressBech": "<string>",
"autoSweepDayOfMonth": 123,
"autoSweepTimezone": "<string>"
}
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
queries: [
{
address: '<string>',
network: '<string>',
yieldId: '<string>',
arguments: {
cAddressBech: '<string>',
pAddressBech: '<string>',
autoSweepDayOfMonth: 123,
autoSweepTimezone: '<string>'
}
}
]
})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances', 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://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'queries' => [
[
'address' => '<string>',
'network' => '<string>',
'yieldId' => '<string>',
'arguments' => [
'cAddressBech' => '<string>',
'pAddressBech' => '<string>',
'autoSweepDayOfMonth' => 123,
'autoSweepTimezone' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances"
payload := strings.NewReader("{\n \"queries\": [\n {\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"yieldId\": \"<string>\",\n \"arguments\": {\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"autoSweepDayOfMonth\": 123,\n \"autoSweepTimezone\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances")
.header("Content-Type", "application/json")
.body("{\n \"queries\": [\n {\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"yieldId\": \"<string>\",\n \"arguments\": {\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"autoSweepDayOfMonth\": 123,\n \"autoSweepTimezone\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"queries\": [\n {\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"yieldId\": \"<string>\",\n \"arguments\": {\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"autoSweepDayOfMonth\": 123,\n \"autoSweepTimezone\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"yieldId": "<string>",
"balances": [
{
"address": "<string>",
"type": "<string>",
"amount": "<string>",
"amountRaw": "<string>",
"pendingActions": [
{
"intent": "<string>",
"type": "<string>",
"passthrough": "<string>",
"arguments": {
"fields": [
{
"name": "<string>",
"type": "<string>",
"label": "<string>",
"description": "<string>",
"required": true,
"options": [
"<string>"
],
"optionsRef": "<string>",
"default": {},
"placeholder": "<string>",
"minimum": "<string>",
"maximum": "<string>",
"isArray": true
}
],
"notes": "<string>"
},
"amount": "<string>"
}
],
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"isEarning": true,
"date": "<string>",
"feeConfigurationId": "<string>",
"validator": {
"address": "<string>",
"name": "<string>",
"logoURI": "<string>",
"website": "<string>",
"rewardRate": {
"total": 123,
"rateType": "<string>",
"components": [
{
"rate": 123,
"rateType": "<string>",
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"yieldSource": "<string>",
"description": "<string>"
}
]
},
"provider": {
"name": "<string>",
"id": "<string>",
"logoURI": "<string>",
"description": "<string>",
"website": "<string>",
"tvlUsd": {},
"type": "<string>",
"rank": 123,
"preferred": true,
"references": [
"<string>"
],
"revshare": {
"trial": {
"minRevShare": 123,
"maxRevShare": 123
},
"standard": {
"minRevShare": 123,
"maxRevShare": 123
},
"pro": {
"minRevShare": 123,
"maxRevShare": 123
}
},
"uniqueId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"commission": 123,
"tvlUsd": "<string>",
"tvl": "<string>",
"tvlRaw": "<string>",
"votingPower": 123,
"preferred": true,
"minimumStake": "<string>",
"remainingPossibleStake": "<string>",
"remainingSlots": 123,
"nominatorCount": 123,
"status": "<string>",
"providerId": "<string>",
"pricePerShare": "<string>",
"subnetId": 123,
"subnetName": "<string>",
"marketCap": "<string>",
"tokenSymbol": "<string>"
},
"validators": [
{
"address": "<string>",
"name": "<string>",
"logoURI": "<string>",
"website": "<string>",
"rewardRate": {
"total": 123,
"rateType": "<string>",
"components": [
{
"rate": 123,
"rateType": "<string>",
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"yieldSource": "<string>",
"description": "<string>"
}
]
},
"provider": {
"name": "<string>",
"id": "<string>",
"logoURI": "<string>",
"description": "<string>",
"website": "<string>",
"tvlUsd": {},
"type": "<string>",
"rank": 123,
"preferred": true,
"references": [
"<string>"
],
"revshare": {
"trial": {
"minRevShare": 123,
"maxRevShare": 123
},
"standard": {
"minRevShare": 123,
"maxRevShare": 123
},
"pro": {
"minRevShare": 123,
"maxRevShare": 123
}
},
"uniqueId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"commission": 123,
"tvlUsd": "<string>",
"tvl": "<string>",
"tvlRaw": "<string>",
"votingPower": 123,
"preferred": true,
"minimumStake": "<string>",
"remainingPossibleStake": "<string>",
"remainingSlots": 123,
"nominatorCount": 123,
"status": "<string>",
"providerId": "<string>",
"pricePerShare": "<string>",
"subnetId": 123,
"subnetName": "<string>",
"marketCap": "<string>",
"tokenSymbol": "<string>"
}
],
"amountUsd": "<string>",
"priceRange": {},
"tokenId": "<string>",
"shareAmount": "<string>",
"shareAmountRaw": "<string>",
"shareToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
}
}
],
"outputTokenBalance": {
"address": "<string>",
"type": "<string>",
"amount": "<string>",
"amountRaw": "<string>",
"pendingActions": [
{
"intent": "<string>",
"type": "<string>",
"passthrough": "<string>",
"arguments": {
"fields": [
{
"name": "<string>",
"type": "<string>",
"label": "<string>",
"description": "<string>",
"required": true,
"options": [
"<string>"
],
"optionsRef": "<string>",
"default": {},
"placeholder": "<string>",
"minimum": "<string>",
"maximum": "<string>",
"isArray": true
}
],
"notes": "<string>"
},
"amount": "<string>"
}
],
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"isEarning": true,
"date": "<string>",
"feeConfigurationId": "<string>",
"validator": {
"address": "<string>",
"name": "<string>",
"logoURI": "<string>",
"website": "<string>",
"rewardRate": {
"total": 123,
"rateType": "<string>",
"components": [
{
"rate": 123,
"rateType": "<string>",
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"yieldSource": "<string>",
"description": "<string>"
}
]
},
"provider": {
"name": "<string>",
"id": "<string>",
"logoURI": "<string>",
"description": "<string>",
"website": "<string>",
"tvlUsd": {},
"type": "<string>",
"rank": 123,
"preferred": true,
"references": [
"<string>"
],
"revshare": {
"trial": {
"minRevShare": 123,
"maxRevShare": 123
},
"standard": {
"minRevShare": 123,
"maxRevShare": 123
},
"pro": {
"minRevShare": 123,
"maxRevShare": 123
}
},
"uniqueId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"commission": 123,
"tvlUsd": "<string>",
"tvl": "<string>",
"tvlRaw": "<string>",
"votingPower": 123,
"preferred": true,
"minimumStake": "<string>",
"remainingPossibleStake": "<string>",
"remainingSlots": 123,
"nominatorCount": 123,
"status": "<string>",
"providerId": "<string>",
"pricePerShare": "<string>",
"subnetId": 123,
"subnetName": "<string>",
"marketCap": "<string>",
"tokenSymbol": "<string>"
},
"validators": [
{
"address": "<string>",
"name": "<string>",
"logoURI": "<string>",
"website": "<string>",
"rewardRate": {
"total": 123,
"rateType": "<string>",
"components": [
{
"rate": 123,
"rateType": "<string>",
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"yieldSource": "<string>",
"description": "<string>"
}
]
},
"provider": {
"name": "<string>",
"id": "<string>",
"logoURI": "<string>",
"description": "<string>",
"website": "<string>",
"tvlUsd": {},
"type": "<string>",
"rank": 123,
"preferred": true,
"references": [
"<string>"
],
"revshare": {
"trial": {
"minRevShare": 123,
"maxRevShare": 123
},
"standard": {
"minRevShare": 123,
"maxRevShare": 123
},
"pro": {
"minRevShare": 123,
"maxRevShare": 123
}
},
"uniqueId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"commission": 123,
"tvlUsd": "<string>",
"tvl": "<string>",
"tvlRaw": "<string>",
"votingPower": 123,
"preferred": true,
"minimumStake": "<string>",
"remainingPossibleStake": "<string>",
"remainingSlots": 123,
"nominatorCount": 123,
"status": "<string>",
"providerId": "<string>",
"pricePerShare": "<string>",
"subnetId": 123,
"subnetName": "<string>",
"marketCap": "<string>",
"tokenSymbol": "<string>"
}
],
"amountUsd": "<string>",
"priceRange": {},
"tokenId": "<string>",
"shareAmount": "<string>",
"shareAmountRaw": "<string>",
"shareToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
}
},
"rewardRate": {
"total": 123,
"rateType": "<string>",
"components": [
{
"rate": 123,
"rateType": "<string>",
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"yieldSource": "<string>",
"description": "<string>"
}
]
}
}
],
"errors": [
{
"yieldId": "<string>",
"error": "<string>"
}
]
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
YieldGetAggregateBalances returns a wallet’s active yield positions across one or more chains. Use this to show users their current DeFi holdings — principal, earned yield, and which markets they are in.
The SDK’s useEarnBalances hook wraps this endpoint — prefer it in React apps.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
queries | object[] | Yes | Array of 1–25 balance queries |
| Field | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Wallet address to look up |
network | string | Yes | Network identifier (e.g. "ethereum", "base", "polygon") |
You can pass up to 25 queries per request, enabling multi-chain balance lookups in a single call.
Response
Returnspayload containing balance records. Each balance entry includes:
| Field | Description |
|---|---|
yieldId | Market ID — matches the id field from YieldGetMarkets |
address | Wallet address |
network | Network the position is on |
amount | Balance amount in the market’s token |
amountUsd | USD value of the position |
Examples
Fetch balances on a single chain
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY',
},
body: JSON.stringify({
queries: [
{
address: '0xYourWalletAddress',
network: 'base',
},
],
}),
})
const { payload } = await response.json()
const balances = JSON.parse(payload)
balances.forEach(position => {
console.log(`${position.yieldId}: ${position.amountUsd} USD`)
})
Multi-chain balance lookup
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetAggregateBalances', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY',
},
body: JSON.stringify({
queries: [
{ address: '0xYourWalletAddress', network: 'base' },
{ address: '0xYourWalletAddress', network: 'ethereum' },
{ address: '0xYourWalletAddress', network: 'polygon' },
],
}),
})
const { payload } = await response.json()
const balances = JSON.parse(payload)
SDK alternative
In React, use theuseEarnBalances hook:
import { useEarnBalances } from '0xtrails'
// Single chain
const { data: balances } = useEarnBalances({
walletAddress: '0xYourWalletAddress',
chain: 'base',
})
// Multiple chains
const { data: balances } = useEarnBalances({
walletAddress: '0xYourWalletAddress',
chains: ['base', 'ethereum', 'polygon'],
})
See also
- YieldGetMarkets — Match
yieldIdagainst market IDs - YieldCreateExitAction — Build withdrawal transactions for active positions
- Markets & Providers — SDK hooks reference
Was this page helpful?
⌘I