YieldGetMarkets returns Yield markets with optional filters.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"chainId": "<string>",
"type": "<string>",
"search": "<string>",
"sort": "<string>",
"limit": 123,
"offset": 123
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets"
payload = {
"provider": "<string>",
"chainId": "<string>",
"type": "<string>",
"search": "<string>",
"sort": "<string>",
"limit": 123,
"offset": 123
}
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({
provider: '<string>',
chainId: '<string>',
type: '<string>',
search: '<string>',
sort: '<string>',
limit: 123,
offset: 123
})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets', 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/YieldGetMarkets",
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([
'provider' => '<string>',
'chainId' => '<string>',
'type' => '<string>',
'search' => '<string>',
'sort' => '<string>',
'limit' => 123,
'offset' => 123
]),
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/YieldGetMarkets"
payload := strings.NewReader("{\n \"provider\": \"<string>\",\n \"chainId\": \"<string>\",\n \"type\": \"<string>\",\n \"search\": \"<string>\",\n \"sort\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123\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/YieldGetMarkets")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"<string>\",\n \"chainId\": \"<string>\",\n \"type\": \"<string>\",\n \"search\": \"<string>\",\n \"sort\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets")
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 \"provider\": \"<string>\",\n \"chainId\": \"<string>\",\n \"type\": \"<string>\",\n \"search\": \"<string>\",\n \"sort\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "<string>",
"network": "<string>",
"inputTokens": [
{
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
}
],
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"tokens": [
{
"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>"
}
]
},
"status": {
"enter": true,
"exit": true
},
"metadata": {
"name": "<string>",
"logoURI": "<string>",
"description": "<string>",
"documentation": "<string>",
"underMaintenance": true,
"deprecated": true,
"supportedStandards": [
"<string>"
]
},
"mechanics": {
"type": "<string>",
"rewardSchedule": "<string>",
"rewardClaiming": "<string>",
"gasFeeToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"requiresValidatorSelection": true,
"lockupPeriod": {
"seconds": 123
},
"cooldownPeriod": {
"seconds": 123
},
"warmupPeriod": {
"seconds": 123
},
"fee": {
"deposit": "<string>",
"withdrawal": "<string>",
"management": "<string>",
"performance": "<string>"
},
"entryLimits": {
"minimum": "<string>",
"maximum": "<string>"
},
"requirements": {
"kycRequired": true,
"kycUrl": "<string>"
},
"supportsLedgerWalletApi": true,
"extraTransactionFormatsSupported": [
"<string>"
],
"arguments": {
"enter": {
"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>"
},
"exit": {
"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>"
},
"manage": {},
"balance": {
"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>"
}
},
"possibleFeeTakingMechanisms": {
"depositFee": true,
"managementFee": true,
"performanceFee": true,
"validatorRebates": true
}
},
"providerId": "<string>",
"supportsBeneficiary": true,
"chainId": "<string>",
"outputToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"statistics": {
"tvlUsd": "<string>",
"tvl": "<string>",
"tvlRaw": "<string>",
"uniqueUsers": 123,
"averagePositionSizeUsd": "<string>",
"averagePositionSize": "<string>"
},
"risk": {
"ratings": [
{
"rating": "<string>",
"source": "<string>"
}
]
},
"curator": {
"name": {},
"description": {},
"logoURI": {}
},
"tags": [
"<string>"
],
"state": {
"pricePerShareState": {
"price": 123,
"shareToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"quoteToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
}
},
"concentratedLiquidityPoolState": {
"baseApr": 123,
"price": 123,
"tickSpacing": 123,
"minTick": 123,
"maxTick": 123,
"feeTier": 123,
"baseToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"quoteToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"volume24hUsd": 123,
"fee24hUsd": 123,
"tvlUsd": 123
},
"capacityState": {
"current": "<string>",
"max": "<string>",
"remaining": "<string>"
},
"liquidityState": {
"liquidity": {},
"utilization": {}
},
"allocations": [
{
"address": "<string>",
"network": "<string>",
"name": "<string>",
"allocation": "<string>",
"weight": 123,
"targetWeight": 123,
"yieldId": "<string>",
"providerId": "<string>",
"allocationUsd": "<string>",
"rewardRate": {
"total": 123,
"rateType": "<string>"
},
"tvl": "<string>",
"tvlUsd": "<string>",
"maxCapacity": "<string>",
"remainingCapacity": "<string>"
}
]
}
}
],
"total": 123,
"offset": 123,
"limit": 123
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Earn
YieldGetMarkets
List and filter DeFi markets available through the Trails earn system
POST
/
rpc
/
Trails
/
YieldGetMarkets
YieldGetMarkets returns Yield markets with optional filters.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"chainId": "<string>",
"type": "<string>",
"search": "<string>",
"sort": "<string>",
"limit": 123,
"offset": 123
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets"
payload = {
"provider": "<string>",
"chainId": "<string>",
"type": "<string>",
"search": "<string>",
"sort": "<string>",
"limit": 123,
"offset": 123
}
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({
provider: '<string>',
chainId: '<string>',
type: '<string>',
search: '<string>',
sort: '<string>',
limit: 123,
offset: 123
})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets', 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/YieldGetMarkets",
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([
'provider' => '<string>',
'chainId' => '<string>',
'type' => '<string>',
'search' => '<string>',
'sort' => '<string>',
'limit' => 123,
'offset' => 123
]),
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/YieldGetMarkets"
payload := strings.NewReader("{\n \"provider\": \"<string>\",\n \"chainId\": \"<string>\",\n \"type\": \"<string>\",\n \"search\": \"<string>\",\n \"sort\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123\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/YieldGetMarkets")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"<string>\",\n \"chainId\": \"<string>\",\n \"type\": \"<string>\",\n \"search\": \"<string>\",\n \"sort\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets")
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 \"provider\": \"<string>\",\n \"chainId\": \"<string>\",\n \"type\": \"<string>\",\n \"search\": \"<string>\",\n \"sort\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "<string>",
"network": "<string>",
"inputTokens": [
{
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
}
],
"token": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"tokens": [
{
"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>"
}
]
},
"status": {
"enter": true,
"exit": true
},
"metadata": {
"name": "<string>",
"logoURI": "<string>",
"description": "<string>",
"documentation": "<string>",
"underMaintenance": true,
"deprecated": true,
"supportedStandards": [
"<string>"
]
},
"mechanics": {
"type": "<string>",
"rewardSchedule": "<string>",
"rewardClaiming": "<string>",
"gasFeeToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"requiresValidatorSelection": true,
"lockupPeriod": {
"seconds": 123
},
"cooldownPeriod": {
"seconds": 123
},
"warmupPeriod": {
"seconds": 123
},
"fee": {
"deposit": "<string>",
"withdrawal": "<string>",
"management": "<string>",
"performance": "<string>"
},
"entryLimits": {
"minimum": "<string>",
"maximum": "<string>"
},
"requirements": {
"kycRequired": true,
"kycUrl": "<string>"
},
"supportsLedgerWalletApi": true,
"extraTransactionFormatsSupported": [
"<string>"
],
"arguments": {
"enter": {
"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>"
},
"exit": {
"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>"
},
"manage": {},
"balance": {
"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>"
}
},
"possibleFeeTakingMechanisms": {
"depositFee": true,
"managementFee": true,
"performanceFee": true,
"validatorRebates": true
}
},
"providerId": "<string>",
"supportsBeneficiary": true,
"chainId": "<string>",
"outputToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"statistics": {
"tvlUsd": "<string>",
"tvl": "<string>",
"tvlRaw": "<string>",
"uniqueUsers": 123,
"averagePositionSizeUsd": "<string>",
"averagePositionSize": "<string>"
},
"risk": {
"ratings": [
{
"rating": "<string>",
"source": "<string>"
}
]
},
"curator": {
"name": {},
"description": {},
"logoURI": {}
},
"tags": [
"<string>"
],
"state": {
"pricePerShareState": {
"price": 123,
"shareToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"quoteToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
}
},
"concentratedLiquidityPoolState": {
"baseApr": 123,
"price": 123,
"tickSpacing": 123,
"minTick": 123,
"maxTick": 123,
"feeTier": 123,
"baseToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"quoteToken": {
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"network": "<string>",
"address": "<string>",
"logoURI": "<string>",
"isPoints": true,
"coinGeckoId": "<string>"
},
"volume24hUsd": 123,
"fee24hUsd": 123,
"tvlUsd": 123
},
"capacityState": {
"current": "<string>",
"max": "<string>",
"remaining": "<string>"
},
"liquidityState": {
"liquidity": {},
"utilization": {}
},
"allocations": [
{
"address": "<string>",
"network": "<string>",
"name": "<string>",
"allocation": "<string>",
"weight": 123,
"targetWeight": 123,
"yieldId": "<string>",
"providerId": "<string>",
"allocationUsd": "<string>",
"rewardRate": {
"total": 123,
"rateType": "<string>"
},
"tvl": "<string>",
"tvlUsd": "<string>",
"maxCapacity": "<string>",
"remainingCapacity": "<string>"
}
]
}
}
],
"total": 123,
"offset": 123,
"limit": 123
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
YieldGetMarkets returns DeFi markets available for deposit through Trails, including lending markets (Aave, Morpho) and yield vaults (Yearn, ERC-4626). Use this to power market selection UIs or discover marketId values for composable actions.
The SDK’s useEarnMarkets hook wraps this endpoint with typed filters and caching — prefer it in React apps.
Request Parameters
All fields are optional.| Field | Type | Description |
|---|---|---|
provider | string | Filter by protocol (e.g. "aave", "morpho", "yearn") |
chainId | string | Filter by chain ID (e.g. "8453" for Base) |
type | string | Market category: "lending" or "vault" |
search | string | Free-text search over market names and tokens |
sort | string | Sort order (e.g. "rewardRateDesc") |
limit | number | Number of results to return |
offset | number | Pagination offset |
Response
Returnspayload containing an array of market objects. Each market includes:
| Field | Description |
|---|---|
id | Unique market ID — pass this to lend() or deposit() composable actions |
providerId | Protocol identifier (e.g. "aave", "morpho") |
rewardRate | Current APY as a decimal (e.g. 0.045 = 4.5%) |
statistics.tvlUsd | Total value locked in USD |
metadata.name | Human-readable market name |
metadata.token | Underlying token info (symbol, address, decimals) |
Examples
List all markets on Base
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY',
},
body: JSON.stringify({
chainId: '8453',
limit: 20,
offset: 0,
}),
})
const { payload } = await response.json()
const markets = JSON.parse(payload)
markets.forEach(market => {
console.log(`${market.id}: ${(market.rewardRate * 100).toFixed(2)}% APY`)
})
Filter lending markets by protocol
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY',
},
body: JSON.stringify({
provider: 'aave',
type: 'lending',
sort: 'rewardRateDesc',
}),
})
const { payload } = await response.json()
const markets = JSON.parse(payload)
Search for USDC markets
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetMarkets', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY',
},
body: JSON.stringify({
search: 'usdc',
sort: 'rewardRateDesc',
limit: 10,
}),
})
SDK alternative
In React, use the typeduseEarnMarkets hook instead of calling this endpoint directly:
import { useEarnMarkets } from '0xtrails'
const { data: markets, isLoading } = useEarnMarkets({
chain: 'base',
type: 'lending',
provider: 'aave',
search: 'usdc',
sortBy: 'rewardRateDesc',
limit: 20,
})
// markets[i].id → pass to lend() or deposit() actions
See also
- YieldGetProviders — List available protocols
- Markets & Providers — SDK hooks reference
Was this page helpful?
⌘I