Skip to main content
Glama
al-one

MCP Server for stock and crypto

okx_taker_volume

Retrieve active buy and sell trading volume data for cryptocurrencies on OKX exchange. Analyze market participation across different time periods and instrument types to understand trader behavior.

Instructions

获取OKX加密货币主动买入和卖出的交易量

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instTypeNo产品类型 SPOT:现货 CONTRACTS:衍生品SPOT
periodNo时间粒度,仅支持: [5m/1H/1D] 注意大小写,仅分钟为小写m1h
symbolNo币种,格式: BTC 或 ETHBTC

Implementation Reference

  • The handler function for the 'okx_taker_volume' tool, including the @mcp.tool decorator which defines the schema (input parameters) and registers the tool. It fetches OKX API data for taker (active buy/sell) volumes, processes it into a DataFrame, and returns formatted CSV.
    @mcp.tool( title="获取加密货币主动买卖情况", description="获取OKX加密货币主动买入和卖出的交易量", ) def okx_taker_volume( symbol: str = Field("BTC", description="币种,格式: BTC 或 ETH"), period: str = Field("1h", description="时间粒度,仅支持: [5m/1H/1D] 注意大小写,仅分钟为小写m"), instType: str = Field("SPOT", description="产品类型 SPOT:现货 CONTRACTS:衍生品"), ): res = requests.get( f"{OKX_BASE_URL}/api/v5/rubik/stat/taker-volume", params={ "ccy": symbol, "period": period, "instType": instType, }, timeout=20, ) data = res.json() or {} dfs = pd.DataFrame(data.get("data", [])) if dfs.empty: return pd.DataFrame() dfs.columns = ["时间", "卖出量", "买入量"] dfs["时间"] = pd.to_datetime(dfs["时间"], errors="coerce", unit="ms") dfs["卖出量"] = pd.to_numeric(dfs["卖出量"], errors="coerce") dfs["买入量"] = pd.to_numeric(dfs["买入量"], errors="coerce") return dfs.to_csv(index=False, float_format="%.2f").strip()

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/al-one/mcp-aktools'

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