Skip to main content
GET
/
v2
/
earn
/
positions
/
{position_id}
Python (SDK)
from compass_api_sdk import CompassAPI


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

    res = compass_api.earn.earn_positions_position_id_(position_id="<id>", user_address="0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c", days=100)

    # Handle response
    print(res)
{
  "position": {
    "type": "VAULT",
    "id": "<string>",
    "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.

Path Parameters

position_id
string
required

Base64-encoded position identifier

Query Parameters

user_address
string
default:0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c
required

The address of the user to get the position for.

days
integer
default:100

How many days back from the current time to include in the blockchain scan (vault positions only).

Required range: 1 <= x <= 365

Response

Successful Response

Response model for a single earn position.

position
object
required

The user's earn position.

  • VaultPosition
  • AavePosition