from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.morpho.morpho_market(chain=models.V1MorphoMarketChain.BASE, unique_market_key="0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5")
# 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.morpho.morphoMarket({
chain: "base",
uniqueMarketKey: "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v1/morpho/market \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v1/morpho/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/morpho/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/morpho/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/morpho/market")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v1/morpho/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{
"whitelisted": true,
"lltv": "<string>",
"dailyApys": {
"borrowApy": "<string>",
"netBorrowApy": "<string>",
"netSupplyApy": "<string>",
"supplyApy": "<string>"
},
"weeklyApys": {
"borrowApy": "<string>",
"netBorrowApy": "<string>",
"netSupplyApy": "<string>",
"supplyApy": "<string>"
},
"monthlyApys": {
"borrowApy": "<string>",
"netBorrowApy": "<string>",
"netSupplyApy": "<string>",
"supplyApy": "<string>"
},
"yearlyApys": {
"borrowApy": "<string>",
"netBorrowApy": "<string>",
"netSupplyApy": "<string>",
"supplyApy": "<string>"
},
"allTimeApys": {
"borrowApy": "<string>",
"netBorrowApy": "<string>",
"netSupplyApy": "<string>",
"supplyApy": "<string>"
},
"loanAsset": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"priceUsd": "<string>",
"logoURI": "<string>"
},
"state": {
"utilization": "<string>",
"borrowAssets": "<string>",
"liquidityAssets": "<string>",
"totalLiquidity": "<string>",
"collateralAssets": "<string>",
"collateralAssetsUsd": "<string>",
"borrowAssetsUsd": "<string>",
"liquidityAssetsUsd": "<string>",
"totalLiquidityUsd": "<string>"
},
"collateralAsset": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"priceUsd": "<string>",
"logoURI": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Market
Get data & metrics for a specific Morpho market.
Including:
- Current, daily, weekly, monthly, yearly APY
- Collateral & loan asset data
- Liquidation loan-to-value ratio
- Collateral, borrow & liquidity value
- Utilization ratio
- Pertinent metadata
- Whitelist status
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.morpho.morpho_market(chain=models.V1MorphoMarketChain.BASE, unique_market_key="0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5")
# 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.morpho.morphoMarket({
chain: "base",
uniqueMarketKey: "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v1/morpho/market \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v1/morpho/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/morpho/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/morpho/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/morpho/market")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v1/morpho/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{
"whitelisted": true,
"lltv": "<string>",
"dailyApys": {
"borrowApy": "<string>",
"netBorrowApy": "<string>",
"netSupplyApy": "<string>",
"supplyApy": "<string>"
},
"weeklyApys": {
"borrowApy": "<string>",
"netBorrowApy": "<string>",
"netSupplyApy": "<string>",
"supplyApy": "<string>"
},
"monthlyApys": {
"borrowApy": "<string>",
"netBorrowApy": "<string>",
"netSupplyApy": "<string>",
"supplyApy": "<string>"
},
"yearlyApys": {
"borrowApy": "<string>",
"netBorrowApy": "<string>",
"netSupplyApy": "<string>",
"supplyApy": "<string>"
},
"allTimeApys": {
"borrowApy": "<string>",
"netBorrowApy": "<string>",
"netSupplyApy": "<string>",
"supplyApy": "<string>"
},
"loanAsset": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"priceUsd": "<string>",
"logoURI": "<string>"
},
"state": {
"utilization": "<string>",
"borrowAssets": "<string>",
"liquidityAssets": "<string>",
"totalLiquidity": "<string>",
"collateralAssets": "<string>",
"collateralAssetsUsd": "<string>",
"borrowAssetsUsd": "<string>",
"liquidityAssetsUsd": "<string>",
"totalLiquidityUsd": "<string>"
},
"collateralAsset": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"priceUsd": "<string>",
"logoURI": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Query Parameters
arbitrum, base, ethereum The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
^0x.*Response
Successful Response
Whether the market is whitelisted or not.
(Liquidation Loan-To-Value) Maximum borrowing percentage before liquidation risk. Scaled by 1e18.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$The daily APYs of the market.
Show child attributes
Show child attributes
The weekly APYs of the market.
Show child attributes
Show child attributes
The monthly APYs of the market.
Show child attributes
Show child attributes
The yearly APYs of the market.
Show child attributes
Show child attributes
The all-time APYs of the market.
Show child attributes
Show child attributes
Data of the underlying loan asset of the market.
Show child attributes
Show child attributes
The current state of the Morpho market.
Show child attributes
Show child attributes
Data of the underlying collateral asset of the market.
Show child attributes
Show child attributes
Was this page helpful?