{"uid":"cap_iPzrFEgC6G6-D1H88tcJl","slug":"delx-commerce-twap-simple-calculator-e99e1bce","name":"Delx Commerce TWAP Simple Calculator","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/twap-simple?utm_source=zero.xyz","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_EN04-bheEA2xT1uEG4_Xe","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 time-weighted average price (TWAP) from an array of price inputs","exampleAgentPrompt":"Calculate the simple TWAP for this price series: [10, 11, 12, 11] — I need the time-weighted average so I can smooth out the noise before placing my trade.","exampleUseCases":[{"title":"Smooth DEX price feed for trading bot","prompt":"I have a list of recent token prices from my DEX feed — [9.8, 10.1, 10.4, 10.2, 10.5] — can you compute the simple TWAP so I can use it as a cleaner price signal in my trading logic?"},{"title":"Reduce price volatility for risk model","prompt":"My risk model needs a stable reference price. I've sampled ETH at [1820, 1835, 1810, 1845, 1830] over the last hour — give me the TWAP so I can avoid reacting to short-term spikes."},{"title":"Verify fair value before executing swap","prompt":"Before I execute this swap, I want to sanity-check against a TWAP. My observed prices were [0.998, 1.002, 0.999, 1.001] — what's the simple time-weighted average?"}],"resultDescription":"Returns a JSON object containing the number of price samples used (n), the computed simple TWAP value (twap), and a schema identifier string (schema: 'delx/util-twap-simple/v1') confirming the calculation method.","failureModes":["Empty or missing prices array returns an error","Non-numeric values in the prices array cause a validation failure","Payment failure via x402 protocol blocks the request","Malformed JSON body results in a 400 error","Single-element array may return a trivial TWAP equal to the sole value"],"whenToPreferThis":"Use this endpoint when you need a quick, cheap ($0.001 USDC), stateless TWAP calculation from a raw array of prices without setting up your own math logic. Ideal for AI agents that gather price samples from multiple sources and need a single smoothed value before making a trade decision or risk assessment. Prefer this over general-purpose math APIs when you want verifiable, pay-per-result delivery with no signup friction.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:53:46.047Z","isFirstParty":false,"canonicalSlug":"delx-commerce-twap-simple-calculator-e99e1bce"}