long_short_ratio

Pack: okx · Connect: https://pipeworx.io/mcp (see Connect below for a single-pack URL)

No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/long_short_ratio for the schema, then POST the same URL with its arguments for the data.

Long/short account ratio for a crypto perpetual contract on the OKX venue — the ratio of accounts holding longs to accounts holding shorts, bucketed by period. A value above 1 means more accounts sit long. Use for positioning and crowd-sentiment reads on a perp.

Parameters

NameTypeRequiredDescription
instIdstringyes
periodstringno5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H or 1D. Default 5m.
bucketsnumbernoRecent buckets to return. Default 24, max 100.

Example call

Arguments

{
  "instId": "MASK-USDT-SWAP",
  "period": "5m",
  "buckets": 24
}

curl

curl -X POST https://gateway.pipeworx.io/okx/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"long_short_ratio","arguments":{"instId":"MASK-USDT-SWAP","period":"5m","buckets":24}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('long_short_ratio', {
  "instId": "MASK-USDT-SWAP",
  "period": "5m",
  "buckets": 24
});

More examples

{
  "instId": "ETHUSDT"
}

Connect

Add this to your MCP client config — every tool in the catalog, including this one — or use one-click install buttons:

{
  "mcpServers": {
    "pipeworx": {
      "url": "https://pipeworx.io/mcp"
    }
  }
}
Connect to just the okx pack
{
  "mcpServers": {
    "okx": {
      "url": "https://gateway.pipeworx.io/okx/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build October 7, 2026