Skip to main content
GET
/
v1
/
morpho
/
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.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>"
}
]
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

chain
enum<string>
default:base
required
Available options:
arbitrum,
base,
ethereum
unique_market_key
string
default:0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5
required

The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.

Pattern: ^0x.*

Response

Successful Response

whitelisted
boolean
required

Whether the market is whitelisted or not.

lltv
string
required

(Liquidation Loan-To-Value) Maximum borrowing percentage before liquidation risk. Scaled by 1e18.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
dailyApys
ApyData · object
required

The daily APYs of the market.

weeklyApys
ApyData · object
required

The weekly APYs of the market.

monthlyApys
ApyData · object
required

The monthly APYs of the market.

yearlyApys
ApyData · object
required

The yearly APYs of the market.

allTimeApys
ApyData · object
required

The all-time APYs of the market.

loanAsset
Asset · object
required

Data of the underlying loan asset of the market.

state
MarketState · object
required

The current state of the Morpho market.

collateralAsset
Asset · object | null

Data of the underlying collateral asset of the market.