Skip to main content
Glama
sv

MCP Paradex Server

by sv

paradex_vault_account_summary

Check vault trading account health, available margin, total exposure, and risk metrics to inform risk management decisions and assess trading capacity.

Instructions

Get a comprehensive overview of a vault's trading account status. Use this tool when you need to: - Check account health and available margin - Monitor total exposure and leverage - Understand risk metrics and account status - Assess trading capacity before placing new orders - Get a consolidated view of account performance This provides essential information about account standing and trading capacity to inform risk management decisions. Example use cases: - Checking available margin before placing new orders - Monitoring account health during market volatility - Assessing total exposure across all markets - Understanding maintenance margin requirements - Planning position adjustments based on account metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vault_addressYesThe address of the vault to get account summary for.

Implementation Reference

  • Main handler function for the 'paradex_vault_account_summary' tool. It takes a vault address, calls the internal API to fetch the account summary from Paradex, validates the response using the VaultAccountSummary model adapter, and returns the list of summaries.
    @server.tool(name="paradex_vault_account_summary") async def get_vault_account_summary( vault_address: Annotated[ str, Field(description="The address of the vault to get account summary for.") ], ) -> list[VaultAccountSummary]: """ Get a comprehensive overview of a vault's trading account status. Use this tool when you need to: - Check account health and available margin - Monitor total exposure and leverage - Understand risk metrics and account status - Assess trading capacity before placing new orders - Get a consolidated view of account performance This provides essential information about account standing and trading capacity to inform risk management decisions. Example use cases: - Checking available margin before placing new orders - Monitoring account health during market volatility - Assessing total exposure across all markets - Understanding maintenance margin requirements - Planning position adjustments based on account metrics """ try: client = await get_paradex_client() response = await api_call( client, "vaults/account-summary", params={"address": vault_address} ) if "error" in response: raise Exception(response["error"]) results = response["results"] summary = vault_account_summary_adapter.validate_python(results) return summary except Exception as e: logger.error(f"Error fetching account summary for vault {vault_address}: {e!s}") raise e
  • Pydantic BaseModel defining the output schema for VaultAccountSummary used in the tool's response validation.
    class VaultAccountSummary(BaseModel): """Model representing an account summary for a vault.""" address: Annotated[str, Field(description="Contract address of the vault")] deposited_amount: Annotated[ str, Field(description="Amount deposited on the vault by the user in USDC") ] vtoken_amount: Annotated[str, Field(description="Amount of vault tokens owned by the user")] total_roi: Annotated[ str, Field(description="Total ROI realized by the user in percentage, i.e. 0.1 means 10%") ] total_pnl: Annotated[str, Field(description="Total P&L realized by the user in USD")] created_at: Annotated[ int, Field(description="Unix timestamp in milliseconds of when the user joined the vault") ]
  • Internal server resource that handles the API call to Paradex for vault account summary, invoked by the tool handler via api_call.
    @server.resource("paradex://vaults/account-summary/{vault_id}") async def get_vault_account_summary(vault_id: str) -> dict[str, Any]: """ Get a summary of market information for a specific trading pair. This endpoint requires authentication and provides detailed information about the market, including order book, ticker, and market statistics. Args: market_id (str): The ID of the trading pair to get summary for. Returns: Dict[str, Any]: Summary of market information. """ try: # Get market summary from Paradex client = await get_paradex_client() summary = await api_call(client, "vaults/account-summary", params={"address": vault_id}) return summary except Exception as e: logger.error(f"Error fetching market summary: {e!s}") return { "success": False, "timestamp": datetime.now().isoformat(), "environment": config.ENVIRONMENT, "error": str(e), "summary": None, }
  • TypeAdapter for validating lists of VaultAccountSummary objects, used in the handler for response parsing.
    vault_account_summary_adapter = TypeAdapter(list[VaultAccountSummary])

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sv/mcp-paradex-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server