# Simple VWAP Calculator

> Simple VWAP Calculator is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Computes volume-weighted average price (VWAP) and total volume from a list of price/size sample pairs using local deterministic math.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/vwap-simple
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/simple-vwap-calculator-688e69fe
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ebGeraBeARXAIwIcAJ_Z3

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 simple-vwap-calculator-688e69fe -d '<json body>'
```

Example prompt: Calculate the VWAP for these trades: [{price: 42100.5, size: 0.3}, {price: 42250.0, size: 0.7}, {price: 42180.0, size: 1.0}] — I want to benchmark my execution against it.

## When to prefer this

Choose this endpoint when you have your own trade print tape or fill data and need a fast, deterministic VWAP computation without any external market data dependency. Ideal for post-trade benchmarking, execution quality analysis, or summarizing multi-leg fills into a single blended price. Prefer this over live-market VWAP feeds when you control the input data and want a pure math result with no API keys, RPC calls, or external latency.

## Known failure modes

- Empty or missing samples array returns an error or undefined VWAP
- Samples with zero or negative sizes may produce division-by-zero or incorrect results
- Malformed sample objects missing price or size fields cause validation errors
- Payment failure via x402 returns 402 Payment Required before computation
- All samples with size zero results in undefined VWAP due to zero total volume

## How this service works

Volume-weighted average price from price/size samples. Call when benchmarking execution against your own print tape. Returns vwap and total volume as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.

## Output

Returns a deterministic JSON object containing the computed VWAP (volume-weighted average price) across all input samples and the total volume summed from all size fields. No external data sources are consulted — the result is purely a function of the submitted samples.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "samples": {
   "type": "array",
   "description": "Input field: samples."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "n": 2,
  "vwap": 11,
  "schema": "delx/util-vwap-simple/v1",
  "volume": 4
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/simple-vwap-calculator-688e69fe/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
