GET
/
v0
/
generic
/
portfolio
/
get
from compassapisdk import CompassAPISDK, models


with CompassAPISDK(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api_sdk:

    res = compass_api_sdk.universal.portfolio(chain=models.GenericPortfolioChain.ARBITRUM_MAINNET)

    # Handle response
    print(res)
{
  "total_value_in_usd": 10000,
  "token_balances": [
    {
      "amount": 1.5,
      "decimals": 18,
      "token_symbol": "WETH",
      "token_address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "price": 2000,
      "token_value_in_usd": 2000
    }
  ]
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

chain
enum<string>
default:arbitrum:mainnet
required

The chain to use.

Available options:
base:mainnet,
ethereum:mainnet,
arbitrum:mainnet
user
string
default:0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B

Response

200
application/json
Successful Response
total_value_in_usd
string
required

Total value of the portfolio in USD

Examples:

10000

token_balances
object[]
required

List of token balances in the portfolio