GET
/
portfolio
/
defi
cURL
curl --request GET \
  --url https://openapiv1.coinstats.app/portfolio/defi \
  --header 'X-API-KEY: <api-key>'
{
  "totalAssets": {
    "USD": 123,
    "ETH": 123,
    "BTC": 123
  },
  "protocols": [
    {
      "id": "<string>",
      "name": "<string>",
      "logo": "<string>",
      "url": "<string>",
      "totalValue": {
        "USD": 123,
        "ETH": 123,
        "BTC": 123
      },
      "blockchain": {
        "name": "<string>",
        "icon": "<string>"
      },
      "chain": "<string>",
      "investments": [
        {
          "id": "<string>",
          "name": "<string>",
          "value": {
            "USD": 123,
            "ETH": 123,
            "BTC": 123
          },
          "symbols": "<string>",
          "assets": [
            {
              "address": "<string>",
              "title": "<string>",
              "coinId": "<string>",
              "logo": "<string>",
              "amount": 123,
              "symbol": "<string>",
              "price": {
                "USD": 123,
                "ETH": 123,
                "BTC": 123
              },
              "danger": true
            }
          ],
          "poolAddress": "<string>",
          "healthRate": 123,
          "healthRateLink": "<string>",
          "poolProjectId": "<string>",
          "unlockAt": "<string>",
          "endAt": "<string>",
          "isProxy": "<string>",
          "debtRatio": 123,
          "debtRatioLink": "<string>"
        }
      ],
      "walletAddress": "<string>"
    }
  ]
}
400 credits per request
Retrieve comprehensive DeFi portfolio data, including staking, liquidity pool (LP), and yield farming activities:
  • Detailed breakdown of DeFi assets and protocols
  • Track staked tokens, LP positions, and earned rewards
Required:
  • shareToken: Get this from your CoinStats portfolio page by clicking “Share” and copying the token from the share URL
Optional:
  • passcode: Optional passcode for accessing protected portfolio data
Note: This endpoint is only available for users with a Degen plan subscription.

Authorizations

X-API-KEY
string
header
required

API key needed to access the endpoints. Example: 'demo-api-key'

Query Parameters

shareToken
string
required

<b>To access your Share Token</b> Visit <a target='_blank' href='https://coinstats.app/portfolio'>CoinStats Portfolio</a> and make sure you are signed in to your account. In the top-right corner of the page, click on the Share button. This will bring up sharing preferences for your portfolio. Generate a Share Link. In the generated URL, the segment following <code>/p/</code> (e.g., <code>XXX</code>) is your share token. Copy only that token (without additional slashes or characters). Use the Token in the API

passcode
string

Optional passcode for accessing protected portfolio data

Example:

"123456"

Response

200
application/json

Defi Response

The response is of type object.