Wallet Portfolio tool

Wallet Portfolio Tool (wallet_portfolio_tool)

Provides a quick overview of token balances and their USD values for a specified Solana wallet. Ideal for checking a user's current holdings.

Input: Requires a Solana wallet public key (agent_public).

class WalletPortfolioInput(BaseModel):
    agent_public: Optional[str] # The public key of the wallet

Key Functionality:

  • Displays detailed info for tokens valued at $0.20 USD or more.

  • Summarizes tokens below this value, showing count and total worth.

  • Calculates and shows the total portfolio value in USD.

  • Data is fetched via the get_wallet_portfolio_ds() .


Sample Usage Queries (How an AI might use it):

  • "What's my portfolio"

  • "How much LUMO do I hold?"

  • "What are my Solana balances?" (Note: While this is SOL's mint, the tool expects a wallet address)

  • "What's the value of the assets?"

  • "Display the holdings for the connected wallet." (If agent_public is pre-filled)

  • "Check my token balances." (If wallet is known)

  • "What's the current portfolio status?"

  • "List all tokens and their values."

  • "How much is worth?"

  • "Provide a summary of assets for wallet."


Quick Code Glance:

class WalletPortfolioTool(BaseTool):
    name: ClassVar[str] = "wallet_portfolio_tool"
    description: ClassVar[str] = "Get detailed information about all tokens held in a wallet..."
    args_schema: ClassVar[Type[BaseModel]] = WalletPortfolioInput

Important:

  • This tool operates asynchronously (_arun).

  • Output accuracy depends on the external data provider.

Last updated