{"uid":"cap_byLO9I7g-70VGNqFbUS98","slug":"simple-twap-time-weighted-average-price-e97e6891","name":"Simple TWAP (Time-Weighted Average Price)","description":"Simple average of price samples for a light TWAP mark. Call when benchmarking fills against an equal-weight path you already hold. Returns twap and sample count 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.","url":"https://api.delx.ai/api/v1/x402/twap-simple","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"prices":{"type":"array","description":"Input field: prices."}}},"responseSchema":{"type":"json","example":{"n":4,"twap":11,"schema":"delx/util-twap-simple/v1"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_s5gLP-KREVMw3CKFSiLg9","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes a simple (equal-weight) average of an array of price samples as a lightweight TWAP mark for benchmarking trade fills.","exampleAgentPrompt":"Calculate a simple equal-weight TWAP for me using these price samples: [100.5, 101.2, 99.8, 100.9, 101.0] — I want to benchmark my fills against it.","exampleUseCases":[{"title":"Benchmarking algo execution quality","prompt":"I have a list of price samples from my execution window — [102.3, 103.1, 101.8, 102.7, 103.5] — can you compute a simple equal-weight TWAP so I can see how my fills compare?"},{"title":"Post-trade fill analysis","prompt":"I just completed a series of trades at prices [50.1, 50.4, 49.9, 50.2, 50.6, 50.3] — calculate the simple average TWAP mark so I can report benchmark slippage to my desk."},{"title":"Lightweight TWAP for DeFi order routing","prompt":"Before I route this on-chain order, give me a simple TWAP from these recent price observations: [1823.5, 1825.0, 1822.3, 1824.8] — I need the average and how many samples were used."}],"resultDescription":"Returns a deterministic JSON object containing the computed TWAP value (simple arithmetic mean of the input price array) and the number of samples used in the calculation.","failureModes":["Empty or missing prices array returns an error or undefined result","Non-numeric values in the prices array cause computation failure","Payment failure via x402 protocol blocks the request","Malformed JSON input body returns a 400-level error","Very large arrays may cause latency spikes though still deterministic"],"whenToPreferThis":"Choose this endpoint when you need a fast, deterministic, equal-weight average of price samples with no external dependencies — no RPC calls, no live market feeds, and no API keys required. Ideal for benchmarking trade fills against a simple TWAP mark where you already hold the price path. Prefer this over volume-weighted alternatives (like VWAP) when fill sizes are equal or irrelevant to the benchmark. Use when you need a $0.001 micropayment-gated, advisory-only price computation with full local math transparency.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:58:51.451Z","isFirstParty":false}