YieldGetMarketById returns a Yield market by market ID.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldGetMarketById \
--header 'Content-Type: application/json' \
--data '
{
"marketId": "<string>"
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldGetMarketById"
payload = { "marketId": "<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({marketId: '<string>'})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetMarketById', 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/YieldGetMarketById",
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([
'marketId' => '<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/YieldGetMarketById"
payload := strings.NewReader("{\n \"marketId\": \"<string>\"\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/YieldGetMarketById")
.header("Content-Type", "application/json")
.body("{\n \"marketId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldGetMarketById")
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 \"marketId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"market": {
"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>"
}
]
}
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Earn
YieldGetMarketById
POST
/
rpc
/
Trails
/
YieldGetMarketById
YieldGetMarketById returns a Yield market by market ID.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldGetMarketById \
--header 'Content-Type: application/json' \
--data '
{
"marketId": "<string>"
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldGetMarketById"
payload = { "marketId": "<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({marketId: '<string>'})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetMarketById', 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/YieldGetMarketById",
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([
'marketId' => '<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/YieldGetMarketById"
payload := strings.NewReader("{\n \"marketId\": \"<string>\"\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/YieldGetMarketById")
.header("Content-Type", "application/json")
.body("{\n \"marketId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldGetMarketById")
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 \"marketId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"market": {
"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>"
}
]
}
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
TheYieldGetMarketById endpoint returns a single yield market — including its tokens, reward rate, statistics, risk ratings, status, mechanics, and current state — by market ID. Use it to fetch full detail for a market discovered through YieldGetMarkets.
Request Parameters
Required Fields
- marketId (string): The market ID returned by
YieldGetMarkets.
Response
- market (
YieldMarket): The full market object. Notable fields:- id, network, chainId, providerId
- inputTokens, outputToken, token, tokens (
YieldToken) - rewardRate (
YieldRewardRate): includestotal,rateType, and per-source components - statistics (
YieldStatistics):tvlUsd,tvl,uniqueUsers, average position size, etc. - risk (
YieldRiskSummary): array of{rating, source}ratings - status (
YieldStatus):{enter, exit}booleans gating entry/exit - mechanics (
YieldMechanics): type, reward schedule, gas fee token, lockup, cooldown, fees, entry limits, requirements - state (
YieldState): price-per-share, concentrated-liquidity-pool state, capacity, liquidity, allocations - supportsBeneficiary (boolean)
Example
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetMarketById', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY'
},
body: JSON.stringify({ marketId: 'market_abc123' })
});
const { market } = await response.json();
console.log(market.providerId, market.rewardRate.total, market.statistics?.tvlUsd);
Next Steps
YieldGetMarkets
Search and list markets
YieldCreateEnterAction
Build a deposit action for a market
Was this page helpful?
⌘I