Skip to main content
GET
/
v1
/
morpho
/
user_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_user_position(chain=models.V1MorphoUserPositionChain.BASE, user_address="0x81d310Eb515E05EB26322e2DeDE9e75b754885A4")

    # Handle response
    print(res)
{
  "state": {
    "vaultsPnlUsd": "<string>",
    "vaultsAssetsUsd": "<string>",
    "marketsPnlUsd": "<string>",
    "marketsBorrowAssetsUsd": "<string>",
    "marketsCollateralUsd": "<string>",
    "marketsSupplyAssetsUsd": "<string>"
  },
  "vaultPositions": [
    {
      "id": "<string>",
      "state": {
        "pnlUsd": "<string>",
        "assets": "<string>",
        "assetsUsd": "<string>",
        "shares": "<string>"
      },
      "vault": {
        "address": "<string>",
        "name": "<string>",
        "symbol": "<string>",
        "whitelisted": true,
        "asset": {
          "name": "<string>",
          "symbol": "<string>",
          "address": "<string>",
          "decimals": 123,
          "priceUsd": "<string>",
          "logoURI": "<string>"
        },
        "dailyApys": {
          "apy": "<string>",
          "netApy": "<string>"
        },
        "weeklyApys": {
          "apy": "<string>",
          "netApy": "<string>"
        },
        "monthlyApys": {
          "apy": "<string>",
          "netApy": "<string>"
        }
      }
    }
  ],
  "marketPositions": [
    {
      "market": {
        "uniqueKey": "<string>"
      },
      "healthFactor": "<string>",
      "priceVariationToLiquidationPrice": "<string>",
      "state": {
        "pnlUsd": "<string>",
        "borrowAssets": "<string>",
        "borrowShares": "<string>",
        "borrowAssetsUsd": "<string>",
        "collateral": "<string>",
        "collateralUsd": "<string>",
        "supplyAssets": "<string>",
        "supplyShares": "<string>",
        "supplyAssetsUsd": "<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 wallet address of the desired user position.

Response

Successful Response

state
object
required

A snapshot of the user's overall state in the Morpho ecosystem.

vaultPositions
VaultPosition · object[]
required

A list of the user's vault positions.

marketPositions
MarketPosition · object[]
required

A list of the user's market positions.