{"uid":"cap_AEyXB7NpZfHSmiuzHlv-m","slug":"base-twap-price-oracle-manipulation-resistant-e9935e7d","name":"Base TWAP Price Oracle (Manipulation-Resistant)","description":"Self-computed Base onchain toolkit for AI agents: ERC-20 safety scan, manipulation-resistant TWAP price oracle, gas/fee oracle, calldata decoder, token/address/contract intel, wallet approval-risk audit, and batch token triage — all computed live from raw Base chain, no third-party data.","url":"https://x402-data-api.bodhinindustries.workers.dev/price","method":"GET","headers":{},"bodySchema":{"type":"object","required":["token"],"properties":{"quote":{"enum":["usdc","weth"],"type":"string","description":"Quote currency: 'usdc' (default) or 'weth'."},"token":{"type":"string","description":"Base ERC-20 contract address to price."},"window":{"type":"integer","description":"TWAP averaging window in seconds (60–7200, default 1800). Longer = more manipulation-resistant."}}},"responseSchema":{"type":"object","properties":{"block":{"type":"integer","description":"Base block height"},"token":{"type":"string","description":"token priced"},"method":{"type":"string","description":"univ3_observe_tick_twap"},"symbol":{"type":"string","description":"token symbol"},"decimals":{"type":"integer","description":"token decimals"},"spotPrice":{"type":"string","description":"current spot price in the quote asset (decimal string)"},"twapPrice":{"type":"string","description":"time-weighted average price in the quote asset (decimal string)"},"computedAt":{"type":"string","description":"ISO-8601 timestamp"},"quoteAsset":{"type":"string","description":"USDC or WETH"},"deviationBps":{"type":"integer","description":"abs(spot-twap)/twap in basis points"},"twapPriceWeth":{"type":"string","description":"TWAP price denominated in WETH"},"windowSeconds":{"type":"integer","description":"window actually used"},"thirdPartyDataUsed":{"type":"boolean","description":"always false — auditable"},"manipulationSuspected":{"type":"boolean","description":"true if deviation is large or liquidity is very low"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ZrbFOp9I4mxgaV0eq9DhL","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns manipulation-resistant TWAP and spot prices for any Base ERC-20 token, computed live from on-chain Uniswap v3 data with deviation and manipulation detection.","exampleAgentPrompt":"What's the manipulation-resistant TWAP price of the Base token at contract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 in USDC, using a 30-minute averaging window — and flag it if the price looks suspicious?","exampleUseCases":[{"title":"Spot vs TWAP deviation check","prompt":"Can you pull the spot price and TWAP for the Base token at 0x4200000000000000000000000000000000000006 in USDC and tell me how many basis points they're drifting apart — I want to know if someone might be manipulating the price right now?"},{"title":"DeFi trade pre-execution price audit","prompt":"Before I execute this swap, grab the on-chain TWAP price for the ERC-20 at 0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb quoted in USDC directly from Base chain data — no CoinGecko — and warn me if anything looks off or suspicious."},{"title":"Token price integrity security scan","prompt":"I'm reviewing this Base token at contract 0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA and I need you to fetch its manipulation-resistant TWAP in WETH, check the deviation from spot price, and flag it if the pricing looks like it could be getting gamed by someone."}],"resultDescription":"Returns a JSON object with the token's current spot price and TWAP price in the requested quote asset (USDC or WETH), the deviation in basis points between spot and TWAP, a boolean flag if manipulation is suspected, token metadata (symbol, decimals), the block height, the window actually used, and a confirmation that no third-party data was used.","failureModes":["Token address not found or not a valid ERC-20 on Base — returns error or empty response","No Uniswap v3 liquidity pool exists for the token — unable to compute TWAP","Window parameter out of range (below 60 or above 7200) — may return validation error","Token has insufficient liquidity for reliable TWAP — manipulationSuspected may be true","Network or RPC errors on Base chain — transient 5xx response","Payment not provided or insufficient — 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need a trustless, auditable, on-chain price for a Base ERC-20 that cannot be spoofed by third-party data feeds. It is ideal for DeFi agents that need manipulation-resistant pricing, security analysis of token price integrity, or any scenario where you cannot trust centralized price oracles. Prefer it over CoinGecko or CoinMarketCap lookups when on-chain auditability matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:36:42.361Z","isFirstParty":false}