from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.credit.credit_morpho_markets(chain=models.V2CreditMorphoMarketsChain.ETHEREUM, offset=0, limit=100, order_by=models.MorphoMarketOrderBy.TVL_USD, direction=models.V2CreditMorphoMarketsDirection.DESC)
# 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.credit.creditMorphoMarkets({
offset: 0,
limit: 100,
chain: "ethereum",
orderBy: "tvl_usd",
direction: "desc",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v2/credit/morpho_markets \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v2/credit/morpho_markets', 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/v2/credit/morpho_markets",
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/v2/credit/morpho_markets"
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/v2/credit/morpho_markets")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v2/credit/morpho_markets")
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{
"total": 123,
"offset": 123,
"limit": 123,
"morpho": "<string>",
"markets": [
{
"available_liquidity": "26607268.0000000000",
"borrow_apy": "4.4410000000",
"collateral_token": "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"collateral_token_decimals": 8,
"collateral_token_symbol": "cbBTC",
"fee": "0.0000000000",
"irm": "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC",
"lltv": "86.0000000000",
"loan_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"loan_token_decimals": 6,
"loan_token_symbol": "USDC",
"market_id": "0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64",
"oracle": "0xA6D6950c9F177F1De7f7757FB33539e3Ec60182a",
"supply_apy": "4.0110000000",
"total_borrow_assets": "247694465.0000000000",
"total_supply_assets": "274301733.0000000000",
"utilization": "90.3000000000"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}List curated Morpho markets
List curated Morpho Blue lending markets for a chain.
Morpho Blue is permissionless, so credit actions identify a market by its bytes32 market id. This returns the curated market set with live LLTV, supply/borrow APY, utilization, and available liquidity — read on-chain per request — so callers know which market_id to use and what it currently costs.
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.credit.credit_morpho_markets(chain=models.V2CreditMorphoMarketsChain.ETHEREUM, offset=0, limit=100, order_by=models.MorphoMarketOrderBy.TVL_USD, direction=models.V2CreditMorphoMarketsDirection.DESC)
# 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.credit.creditMorphoMarkets({
offset: 0,
limit: 100,
chain: "ethereum",
orderBy: "tvl_usd",
direction: "desc",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v2/credit/morpho_markets \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v2/credit/morpho_markets', 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/v2/credit/morpho_markets",
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/v2/credit/morpho_markets"
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/v2/credit/morpho_markets")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v2/credit/morpho_markets")
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{
"total": 123,
"offset": 123,
"limit": 123,
"morpho": "<string>",
"markets": [
{
"available_liquidity": "26607268.0000000000",
"borrow_apy": "4.4410000000",
"collateral_token": "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"collateral_token_decimals": 8,
"collateral_token_symbol": "cbBTC",
"fee": "0.0000000000",
"irm": "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC",
"lltv": "86.0000000000",
"loan_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"loan_token_decimals": 6,
"loan_token_symbol": "USDC",
"market_id": "0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64",
"oracle": "0xA6D6950c9F177F1De7f7757FB33539e3Ec60182a",
"supply_apy": "4.0110000000",
"total_borrow_assets": "247694465.0000000000",
"total_supply_assets": "274301733.0000000000",
"utilization": "90.3000000000"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Query Parameters
The offset of the first item to return.
The number of items to return.
x <= 1000arbitrum, base, bsc, ethereum, hyperevm, tempo Field to order the markets by before paginating. Columns the Morpho markets list can be ordered by. All are stored by the indexer, so ordering + paging happen on the DB set before the (expensive) per-market on-chain enrichment — only the requested page is read on-chain.
tvl_usd, liquidity_usd, lltv Order direction (asc/desc).
asc, desc Response
Successful Response
A page of Morpho Blue lending markets, ordered + paginated on the DB set; each returned market is enriched with live on-chain LLTV/APY/utilisation.
Morpho Blue singleton contract the markets were read from.
This page of lending markets (already ordered) with live LLTV, APYs, utilization, and liquidity. total is the full market count.
Show child attributes
Show child attributes
[
{
"available_liquidity": "26607268.0000000000",
"borrow_apy": "4.4410000000",
"collateral_token": "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"collateral_token_decimals": 8,
"collateral_token_symbol": "cbBTC",
"fee": "0.0000000000",
"irm": "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC",
"lltv": "86.0000000000",
"loan_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"loan_token_decimals": 6,
"loan_token_symbol": "USDC",
"market_id": "0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64",
"oracle": "0xA6D6950c9F177F1De7f7757FB33539e3Ec60182a",
"supply_apy": "4.0110000000",
"total_borrow_assets": "247694465.0000000000",
"total_supply_assets": "274301733.0000000000",
"utilization": "90.3000000000"
}
]
Was this page helpful?