get https://api.openpool.co/wallet/portfolio_summary/
This endpoint returns summarized financial metrics across both your token holdings and DeFi activities, including Total Current Value, Unrealized P&L, Realized P&L, Cost Basis, Claimed Rewards, Claimable Rewards, and DeFi Accruals.
Note that responses are normalized to the currency you selected (default is USD).
- Portfolio Summary Metrics - total_value and total_unrealized_pnl are across total token and DeFi positions.
- Token Summary Metrics - total_realized_pnl and cost_method (refers to cost accounting method used to calculated Realized PnL) pertain to token holdings activity.
- DeFi Position Metrics - total_claimed_rewards, total_principal, total_accrual, total_claimable_rewards, total_borrowing_interest, and total_lending_interest pertain to DeFi positions.
- Total Principal - DeFi principal investment expressed in the reference currency selected. Default is USD.
- Total Accrual - Calculated as Total Borrowing interest + Total Lending interest + Total Staking interest. If Total Accrual is negative, this indicates that on a net basis, interest owed on borrowing positions exceeds interest earned on lending and staking positions. Expressed in the reference currency selected. Default is USD.
- Borrow - Represents total interest owed on all borrow positions (detractor from P&L). Expressed in the reference currency selected. Default is USD.
- Lend - Represents total interest earned on all lending positions (additive to P&L). Expressed in the reference currency selected. Default is USD.
- Stake - Represents total interest earned on all staking positions (additive to P&L). Expressed in the reference currency selected. Default is USD.
Successful Query Example
curl --request GET \
--url 'https://api.openpool.co/wallet/portfolio_summary/?wallet=0xd4dbf96db2fdf8ed40296d8d104b371adf7dee12' \
--header 'X-API-KEY: <insert_api_key>' \
--header 'accept: application/json'
Successful Response Example
{'total_value': 2070.481727521277,
'total_unrealized_pnl': -120.35247174467834,
'total_realized_pnl': -157.48742478,
'income': {'total_claimed_rewards': 0},
'defi': {'total_principal': 808.9532125745275,
'total_accrual': 80.32969532533255,
'total_claimable_rewards': 473.8513179223135,
'total_accrual_breakdown': {'borrow': -3.6470223154061423,
'lend': 0.037325131200143205,
'stake': 83.93939250953855}},
'currency': 'USD',
'cost_method': 'FIFO'}