Portfolio

Get All Positions for a Single Wallet

Returns all positions of a given wallet address. For a full list of supported asset types, please see here.

https://api.treehouse.finance/v2/portfolio/all_positions
    ?wallet=0x5853ed4f26a3fcea565b3fbc698bb19cdf6deb85
    &chains=eth
    &date=2023-01-17
    &access_key=yourApiKey

All Positions

GET https://api.treehouse.finance/v2/portfolio/all_positions

Query Parameters

NameTypeDescription

wallet*

String

Wallet address

chains*

String

Treehouse chain_id representing a particular chain

date

ISO 8601

The date at which the position snapshot is queried (format: YYYY-MM-DD)

{
    "status": "OK",
    "data": [
        {
            "wallet_id": string,
            "date": datetime,
            "positions": [
                {
                    "asset_type": string,
                    "chain_id": string,
                    "protocol_id": string,
                    "cid": string,
                    "name": string,
                    "symbol": string,
                    "principal_nav": float,
                    "reward_nav": float,
                    "underlying": [
                        {
                            "internal_id": string,
                            "name": string,
                            "symbol": string,
                            "qty": float,
                            "nav": float,
                            "details": {    # Underlying details will vary depending on the asset_type
                                "is_reward": boolean,
                                "type": string,
                                "debt_positions: [list of internal_id],
                                "collateral": [list of internal_id],
                                "liq_threshold": float,
                                "collateral_debt_ratio": float,
                                "unlock_time": datetime,
                                "voting_power": float,
                                "exchange_rate": float
                            }
                        }
                    ]
                }
            ]
        }
    ],
    "message": "Get Positions (ID: requestId) succeed."
}

Get All Positions Grouped by Underlying Asset for a Single Wallet

Returns all positions of a given wallet address, grouped by their underlying assets. For a full list of supported asset types, please see here.

https://api.treehouse.finance/v1/portfolio/positions_by_underlying
    ?wallet=0x5853ed4f26a3fcea565b3fbc698bb19cdf6deb85
    &chains=eth
    &date=2023-01-17
    &access_key=yourApiKey

Positions by Underlying

GET https://api.treehouse.finance/v1/portfolio/positions_by_underlying

Query Parameters

NameTypeDescription

wallet*

String

Wallet address

chains*

String

Treehouse chain_id representing a particular chain

date

ISO 8601

The date at which the position snapshot is queried (format: YYYY-MM-DD)

{
    "status": "OK",
    "data": [
        {
            "wallet_id": string,
            "date": datetime,
            "positions": [
                {
                    "token_id": string,
                    "token_name": string,
                    "token_symbol": string,
                    "token_cid": string,
                    "total_qty": float,
                    "total_nav": float,
                    "breakdown": [
                        {
                            "chain_id": string,
                            "pos_id": string,
                            "asset_type": string,
                            "cid": string,
                            "protocol_id": string,
                            "name": string,
                            "qty": float,
                            "nav": float
                        }
                    ]
                }
            ]
        }
    ],
    "message": "Get positions by underlying (ID: requestId) succeed."
}

Get All Positions with Liquidity Metrics for a Single Wallet

Returns all positions with additional liquidity metrics of a given wallet address. For a full list of supported asset types, please see here.

https://api.treehouse.finance/v1/portfolio/port_liq_analysis?
    ?wallet=0x5853ed4f26a3fcea565b3fbc698bb19cdf6deb85
    &chains=eth
    &access_key=yourApiKey

Portfolio Liquidity Analysis

GET https://api.treehouse.finance/v1/portfolio/port_liq_analysis

Query Parameters

NameTypeDescription

wallet*

String

Wallet address

chains*

String

Treehouse chain_id representing a particular chain

date

ISO 8601

The date at which the position snapshot is queried (format: YYYY-MM-DD)

asset_type

String

List of Treehouse supported asset types

{
    "status": "OK",
    "data": [
        {
            "wallet_id": string,
            "date": datetime,
            "positions": [
                {
                    "asset_type": string,
                    "chain_id": string,
                    "protocol_id": string,
                    "cid": string,
                    "principal_token_name": string,
                    "principal_token_symbol": string,
                    "principal_qty": float,
                    "principal_total_supply": float,
                    "principal_pct_ownership": float,
                    "underlying": [
                        {
                            "name": string,
                            "symbol": string,
                            "qty": float,
                            "total_supply": float,
                            "pct_ownership": float,
                            "details": {    # Underlying details will vary depending on the asset_type
                                "is_reward": boolean,
                                "slippage": float,
                                "unlocked_time": datetime,
                                "exchange_rate": float,
                                "voting_power": float,
                                "liq_threshold": float,
                                "debt_positions: [list of internal_id],
                                "collaterals": [list of internal_id]
                            
                        }
                    ]
                }
            ]
        }
    ],
    "message": "Get portfolio liqudity analysis (ID: requestId) succeed."
}

Last updated