Skip to main content
GET
/
v1
/
morpho
/
market_position
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_position(chain=models.V1MorphoMarketPositionChain.BASE, user_address="0x81d310Eb515E05EB26322e2DeDE9e75b754885A4", unique_market_key="0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5")

    # Handle response
    print(res)
{
  "borrow_shares": 123,
  "borrow_amount": "<string>",
  "collateral_amount": "<string>",
  "current_loan_to_value": "<string>",
  "liquidation_loan_to_value_threshold": "<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
user_address
string
default:0x81d310Eb515E05EB26322e2DeDE9e75b754885A4
required

The user address of the desired market position.

unique_market_key
string
default:0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5
required

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

Response

Successful Response

borrow_shares
integer
required
borrow_amount
string
required

The amount of the loan token borrowed.

collateral_amount
string
required

The amount of the collateral token supplied.

current_loan_to_value
string
required

The Loan-To-Value ratio measures the proportion of debt relative to collateral value. If this ratio exceeds the 'liquidation_loan_to_value_threshold', the position is liquidatable.

liquidation_loan_to_value_threshold
string
required

Maximum borrowing percentage before liquidation risk. E.g: LLTV of 80% means for a collateral value equivalent of $100, the maximum one can borrow in value is $80. If above like $80.0001, the position is liquidatable.