# Token Bid-Ask Spread Weighted Mean

> Token Bid-Ask Spread Weighted Mean is a paid API for AI agents from market.datapackvibe.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-16).

Computes a weighted mean of bid-ask spread observations for a token, given an array of bid/ask price pairs and corresponding weights.

## Facts

- Endpoint: POST https://market.datapackvibe.com/x402/assistant-bx-token-quote-spread-weighted-mean?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/token-bid-ask-spread-weighted-mean-b073d26a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JoIHyznQMXAvS03iB_lO8

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability token-bid-ask-spread-weighted-mean-b073d26a -d '<json body>'
```

Example prompt: Calculate the weighted mean bid-ask spread for this token using these 4 observations: bids [0.98, 1.078, 0.98, 1.078] and asks [1.02, 1.122, 1.02, 1.122], with weights [1, 2, 1, 2].

## When to prefer this

Choose this endpoint when you need a deterministic, weighted aggregation of bid-ask spread observations for a token and already have the raw bid/ask data in hand. Prefer it over raw spread calculators when different observations should contribute unequally to the result (e.g. by volume, recency, or venue quality). It is not a live market scanner or a trade signal — use it for post-hoc analysis, reporting, or pre-trade spread benchmarking from collected quote data.

## Known failure modes

- Fewer than 2 rows provided — minimum of 2 bid/ask observation pairs required
- Weights array length does not match rows array length — arrays must be equal in length
- Bid or ask value is zero or negative — all prices must be strictly positive
- Ask value less than or equal to bid value for a row — inverted spread not supported
- Row count exceeds 200 maximum items limit
- Weight value exceeds maximum of 1,000,000,000,000

## How this service works

Token bid-ask spread — Weighted result mean: Weighted result mean for Token bid-ask spread. Supplied token observations only. Deterministic calculation or caller-threshold verdict, not a live scan, safety proof or trade recommendation. Specialised preset in a shared 50-profile, 20-operation engine. 0.01 USDC includes one bounded weighted result mean report.

## Output

A single weighted mean value representing the average bid-ask spread across the supplied token price observations, computed deterministically from the provided bid/ask pairs and their associated weights. No live market scanning or trade recommendation is included.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "rows": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "ask",
     "bid"
    ],
    "properties": {
     "ask": {
      "type": "number",
      "default": 1.02,
      "maximum": 10000000000000000,
      "minimum": 0,
      "exclusiveMinimum": 0
     },
     "bid": {
      "type": "number",
      "default": 0.98,
      "maximum": 10000000000000000,
      "minimum": 0,
      "exclusiveMinimum": 0
     }
    },
    "additionalProperties": false
   },
   "default": [
    {
     "ask": 1.02,
     "bid": 0.98
    },
    {
     "ask": 1.122,
     "bid": 1.078
    },
    {
     "ask": 1.02,
     "bid": 0.98
    },
    {
     "ask": 1.122,
     "bid": 1.078
    }
   ],
   "maxItems": 200,
   "minItems": 2
  },
  "weights": {
   "type": "array",
   "items": {
    "type": "number",
    "default": 1,
    "maximum": 1000000000000,
    "minimum": 0
   },
   "default": [
    1,
    2,
    1,
    2
   ],
   "maxItems": 200,
   "minItems": 2
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/token-bid-ask-spread-weighted-mean-b073d26a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from market.datapackvibe.com](https://www.zero.xyz/host/market.datapackvibe.com/llms.txt)
