get_options_summary
Retrieve summarized options DEX volume data, including historical trends, for specific protocols using protocol slug and customizable data types like dailyPremiumVolume or dailyNotionalVolume.
Instructions
GET /api/summary/options/{protocol}
Get summary of options dex volume with historical data.
Parameters:
protocol: protocol slug (e.g., 'lyra')
data_type: desired data type (default: 'dailyNotionalVolume')
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data_type | No | dailyNotionalVolume | |
| protocol | Yes |
Implementation Reference
- defillama_server.py:858-873 (handler)The main handler function for the 'get_options_summary' tool. It is decorated with @mcp.tool() which registers it in the FastMCP server. The function makes an HTTP GET request to the DefiLlama API's options summary endpoint using the shared make_request helper.@mcp.tool() async def get_options_summary( protocol: str, data_type: Literal['dailyPremiumVolume', 'dailyNotionalVolume'] = 'dailyNotionalVolume' ) -> str: """GET /api/summary/options/{protocol} Get summary of options dex volume with historical data. Parameters: protocol: protocol slug (e.g., 'lyra') data_type: desired data type (default: 'dailyNotionalVolume') """ params = {'dataType': data_type} result = await make_request('GET', f'/api/summary/options/{protocol}', params) return str(result)
- defillama_server.py:30-38 (helper)Shared utility function used by all DefiLlama API tools, including get_options_summary, to perform authenticated HTTP requests and handle responses.async def make_request(method: str, endpoint: str, params: Optional[Dict[str, Any]] = None) -> Any: """Make a request to the DefiLlama API.""" try: response = await client.request(method, endpoint, params=params) response.raise_for_status() return response.json() except Exception as e: return f"Error: {str(e)}"