Aave V3
Aerodrome Slipstream
Morpho
Uniswap V3
Universal
Pendle
Transaction Batching
Smart Account
Pendle
List User's Market Positions
List the user’s SY, PT, YT and LP positions for all markets on a given chain.
GET
/
v0
/
pendle
/
positions
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.pendle.positions(chain=models.PendlePositionsChain.ETHEREUM_MAINNET, user_address="0xa829B388A3DF7f581cE957a95edbe419dd146d1B")
# Handle response
print(res)
{
"positions": [
{
"chainId": 123,
"totalOpen": 123,
"totalClosed": 123,
"totalSy": 123,
"openPositions": [
{
"marketId": "<string>",
"pt": {
"valuation": 123,
"balance": "<string>"
},
"yt": {
"valuation": 123,
"balance": "<string>"
},
"lp": {
"valuation": 123,
"balance": "<string>",
"activeBalance": "<string>"
}
}
],
"closedPositions": [
{
"marketId": "<string>",
"pt": {
"valuation": 123,
"balance": "<string>"
},
"yt": {
"valuation": 123,
"balance": "<string>"
},
"lp": {
"valuation": 123,
"balance": "<string>",
"activeBalance": "<string>"
}
}
],
"syPositions": [
{
"syId": "<string>",
"balance": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
Query Parameters
The chain to use.
Available options:
base:mainnet
, ethereum:mainnet
, arbitrum:mainnet
Optional block number (defaults to latest).
The user address of the desired position.
Response
200
application/json
Successful Response
The response is of type object
.
Was this page helpful?
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.pendle.positions(chain=models.PendlePositionsChain.ETHEREUM_MAINNET, user_address="0xa829B388A3DF7f581cE957a95edbe419dd146d1B")
# Handle response
print(res)
{
"positions": [
{
"chainId": 123,
"totalOpen": 123,
"totalClosed": 123,
"totalSy": 123,
"openPositions": [
{
"marketId": "<string>",
"pt": {
"valuation": 123,
"balance": "<string>"
},
"yt": {
"valuation": 123,
"balance": "<string>"
},
"lp": {
"valuation": 123,
"balance": "<string>",
"activeBalance": "<string>"
}
}
],
"closedPositions": [
{
"marketId": "<string>",
"pt": {
"valuation": 123,
"balance": "<string>"
},
"yt": {
"valuation": 123,
"balance": "<string>"
},
"lp": {
"valuation": 123,
"balance": "<string>",
"activeBalance": "<string>"
}
}
],
"syPositions": [
{
"syId": "<string>",
"balance": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.