Skip to main content
GET
/
v2
/
credit
/
morpho_markets
Python (SDK)
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>"
}
]
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

offset
integer
default:0

The offset of the first item to return.

limit
integer
default:100

The number of items to return.

Required range: x <= 1000
chain
enum<string>
default:ethereum
required
Available options:
arbitrum,
base,
bsc,
ethereum,
tempo
order_by
enum<string>
default:tvl_usd

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.

Available options:
tvl_usd,
liquidity_usd,
lltv
direction
enum<string>
default:desc

Order direction (asc/desc).

Available options:
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.

total
integer
required
offset
integer
required
limit
integer
required
morpho
string
required

Morpho Blue singleton contract the markets were read from.

markets
MorphoLendingMarket · object[]

This page of lending markets (already ordered) with live LLTV, APYs, utilization, and liquidity. total is the full market count.

Example:
[
{
"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"
}
]