Skip to main content
GET
/
v2
/
earn
/
positions
Python (SDK)
from compass_api_sdk import CompassAPI, models


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.earn.earn_positions(chain=models.V2EarnPositionsChain.BASE, user_address="0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c", offset=0, limit=100, days=30)

    # Handle response
    print(res)
{
  "user_positions": [
    {
      "type": "VAULT",
      "vault_address": "0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB",
      "amount_in_underlying_token": "<string>",
      "token_name": "<string>",
      "vault_name": "<string>"
    }
  ]
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

offset
integer
default:0

The offset of the first item to return.

limit
integer
default:100

The number of items to return.

Required range: 0 < x <= 1000
chain
enum<string>
default:base
required
Available options:
arbitrum,
base,
ethereum
user_address
string
default:0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c
required

The address of the user to get vault positions for.

days
integer
default:30

How many days back from the current time to include in the blockchain scan.

Required range: 1 <= x <= 365

Response

Successful Response

user_positions
User Positions · array
required

A list of the user's earn positions.

  • VaultPosition
  • AavePosition