# SignalHarness Market TWAP Calculator

> SignalHarness Market TWAP Calculator is a paid API for AI agents from signalharness.ai, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-13).

Computes a Time-Weighted Average Price (TWAP) for a given market or asset based on caller-supplied data

## Facts

- Endpoint: POST https://signalharness.ai/api/agent/services/market_twap/invoke
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/signalharness-market-twap-calculator-69569266
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_m0_5oGSjf6TA9MEPTdLka

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 signalharness-market-twap-calculator-69569266 -d '<json body>'
```

Example prompt: Calculate the time-weighted average price (TWAP) for ETH/USDC over the last 4 hours using the price data I'm providing — I need this for a DeFi trading strategy to minimize slippage.

## When to prefer this

Choose this endpoint when you need a verifiable, agent-native TWAP calculation with a cryptographic receipt (SHA-256 result hash, payment proof) rather than pulling raw price feeds from a CEX or DEX API. Best suited for DeFi agents that need auditable price computation at low cost ($0.005 USDC per call) and can supply their own price series for processing. Prefer this over raw oracle reads when you need a signed artifact proving the computation was performed.

## Known failure modes

- Malformed or unparseable twap_request string returns an error status
- twap_request below 2 characters or above 65536 characters is rejected by schema validation
- Insufficient or inconsistent price data in the request may produce warnings or failed computation
- Payment failure on the x402 micropayment layer prevents execution
- Missing required fields in the TWAP request body cause validation errors

## How this service works

Explore 330 pay-per-call x402 API services and 27 agent-native digital products, with Base USDC pricing, secure Polar checkout, and free discovery.

## Output

Returns a JSON object containing the TWAP calculation string, any warnings about the input data, an evidence scope indicator (e.g. 'caller_supplied_data'), the service ID, plus a signed receipt with payment details including the USDC amount paid, network (Base/EIP-155:8453), request/execution IDs, result SHA-256 hash, and latency metrics.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "twap_request": {
   "type": "string",
   "maxLength": 65536,
   "minLength": 2
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "replay": false,
  "result": {
   "warnings": [
    "TWAP coverage and observation quality are caller controlled."
   ],
   "service_id": "market_twap",
   "evidence_scope": "caller_supplied_data",
   "twap_calculation": "{\"duration_ms\":\"1000\",\"observation_count\":2,\"twap\":\"10\",\"weighting\":\"left_continuous\"}"
  },
  "status": "succeeded",
  "receipt": {
   "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
   "usage": [],
   "status": "succeeded",
   "network": "eip155:8453",
   "artifacts": [],
   "endedAtMs": 0,
   "latencyMs": 0,
   "paymentId": "example-payment",
   "receiptId": "example-receipt",
   "requestId": "example-request",
   "serviceId": "market_twap",
   "executionId": "example-execution",
   "startedAtMs": 0,
   "amountAtomic": "5000",
   "resultSha256": "90a9235ba27d3ed5806c8c393d3fcc459b25283b3de1823809767df300ba5a7a",
   "serviceVersion": "1.0.0",
   "settlementReference": "0x0000000000000000000000000000000000000000000000000000000000000000"
  },
  "artifacts": [],
  "requestId": "example-request",
  "executionId": "example-execution"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/signalharness-market-twap-calculator-69569266/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from signalharness.ai](https://www.zero.xyz/host/signalharness.ai/llms.txt)
