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="0x73EEf7ba2E20ad05A04925C8Bc65c555B5fba26B", offset=0, limit=100, days=30)

    # Handle response
    print(res)
{
  "user_positions": [
    {
      "vault_address": "<string>",
      "amount_in_underlying_token": "<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:0x73EEf7ba2E20ad05A04925C8Bc65c555B5fba26B
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
UserPosition · object[]
required

A list of the user's vault positions.