Python (SDK)
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.pendle.pendle_market(chain=models.V1PendleMarketChain.ARBITRUM, market_address="0x46d62a8dede1bf2d0de04f2ed863245cbba5e538", user_address="0x68C314e30b543a35819e5625da563E6Da65D5dd4")
# Handle response
print(res)import { CompassApiSDK } from "@compass-labs/api-sdk";
const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await compassApiSDK.pendle.pendleMarket({
chain: "arbitrum",
marketAddress: "0x46d62a8dede1bf2d0de04f2ed863245cbba5e538",
userAddress: "0x68C314e30b543a35819e5625da563E6Da65D5dd4",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v1/pendle/market \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v1/pendle/market', 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.compasslabs.ai/v1/pendle/market",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.compasslabs.ai/v1/pendle/market"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.compasslabs.ai/v1/pendle/market")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v1/pendle/market")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"market_address": "<string>",
"implied_apy": "<string>",
"maturity_date": "2023-11-07T05:31:56Z",
"tokens": {
"underlying_token": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123
},
"sy": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123
},
"pt": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123
},
"yt": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123
},
"accounting_asset": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123
}
},
"user_position": {
"claimable_yield": "<string>",
"sy_balance": "<string>",
"pt_balance": "<string>",
"yt_balance": "<string>",
"lp_balance": "<string>",
"underlying_token_balance": "<string>",
"accounting_asset_balance": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Pendle
Get Market & User Position
Get the market’s implied APY, maturity date and the associated token data.
The user position is only included if ‘user_address’ parameter is included.
GET
/
v1
/
pendle
/
market
Python (SDK)
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.pendle.pendle_market(chain=models.V1PendleMarketChain.ARBITRUM, market_address="0x46d62a8dede1bf2d0de04f2ed863245cbba5e538", user_address="0x68C314e30b543a35819e5625da563E6Da65D5dd4")
# Handle response
print(res)import { CompassApiSDK } from "@compass-labs/api-sdk";
const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await compassApiSDK.pendle.pendleMarket({
chain: "arbitrum",
marketAddress: "0x46d62a8dede1bf2d0de04f2ed863245cbba5e538",
userAddress: "0x68C314e30b543a35819e5625da563E6Da65D5dd4",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v1/pendle/market \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v1/pendle/market', 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.compasslabs.ai/v1/pendle/market",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.compasslabs.ai/v1/pendle/market"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.compasslabs.ai/v1/pendle/market")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v1/pendle/market")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"market_address": "<string>",
"implied_apy": "<string>",
"maturity_date": "2023-11-07T05:31:56Z",
"tokens": {
"underlying_token": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123
},
"sy": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123
},
"pt": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123
},
"yt": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123
},
"accounting_asset": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123
}
},
"user_position": {
"claimable_yield": "<string>",
"sy_balance": "<string>",
"pt_balance": "<string>",
"yt_balance": "<string>",
"lp_balance": "<string>",
"underlying_token_balance": "<string>",
"accounting_asset_balance": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Query Parameters
Available options:
arbitrum, base, ethereum Optional block number (defaults to latest).
The market address of the desired position.
The user address of the desired market position. Only include if you would like the user position included in the response. Defaults to None.
Response
Successful Response
The address of the market.
The implied APY of the market.
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$The maturity date of the market. ISO 8601 format. UTC timezone.
Token data relevant to the market.
Show child attributes
Show child attributes
The user's position in the market.
Show child attributes
Show child attributes
Was this page helpful?