{"uid":"cap_-PA9jA7a9lkP_UHhqoe40","slug":"1gateway-on-chain-token-price-api-3a545c24","name":"1gateway On-Chain Token Price API","description":"Use when an agent needs a token's USD price without a third-party price feed. Input: tokens (up to 10, base:0x… or sol:<mint>). Output: per token priceUsd, confidence, the pool used (Uniswap v3 / Aerodrome on Base, Orca Whirlpool on Solana; fee tier, depth in USD), path (direct USDC or via WETH/SOL), warnings; no price below $1,000 depth. Spot, not TWAP. Example: ?tokens=base:0x940181a94A35A4569E4529A3CDfB74e38FD98631","url":"https://1gateway.dev/v1/onchain/prices?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["tokens"],"properties":{"tokens":{"type":"string","pattern":"^(?:(?:base|sol|solana):[0-9A-Za-z]{32,44}|[A-Za-z]{2,6})(?:,(?:(?:base|sol|solana):[0-9A-Za-z]{32,44}|[A-Za-z]{2,6})){0,9}$","description":"Comma-separated chain:address list, max 10 (base:0x… ERC-20, sol:<mint> base58), or tickers BTC, ET…"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["prices","asOf","method","notes","rpc"],"properties":{"rpc":{"type":"object","properties":{"kind":{"type":"string"},"source":{"type":"string"}},"additionalProperties":true},"asOf":{"type":"object","properties":{"at":{"type":"string"},"baseBlock":{"type":"integer"},"solanaSlot":{"type":"integer"}},"additionalProperties":true},"notes":{"type":"array","items":{"type":"string"}},"method":{"type":"object","properties":{"dexes":{"type":"object","additionalProperties":true},"depthUsd":{"type":"string"},"floorUsd":{"type":"integer"},"lowConfidenceBelowUsd":{"type":"integer"}},"additionalProperties":true},"prices":{"type":"array","items":{"type":"object","additionalProperties":true}}},"additionalProperties":true}}}}},"responseSchema":{"type":"json","example":{"rpc":{"kind":"public","source":"base-rpc.publicnode.com"},"asOf":{"at":"2026-10-24T23:27:00.257Z","baseBlock":53047536,"solanaSlot":461036588},"notes":["Computed from onchain pool state at the block/slot above; no third-party price feed."],"method":{"dexes":{"base":["uniswap_v3"],"solana":["orca_whirlpool"]},"depthUsd":"2 × the pool's quote-side balance (USDC, or WETH/SOL converted to USD)","floorUsd":1000,"lowConfidenceBelowUsd":50000},"prices":[{"path":["WETH"],"pool":{"dex":"uniswap_v3","quote":"USDC","address":"0x6c561b446416e1a00e8e93e221854d6ea4171372","feeTier":"0.3%","depthUsd":83615789},"chain":"base","token":"0x4200000000000000000000000000000000000006","symbol":"WETH","priceUsd":2338.8024,"warnings":[],"confidence":"high"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_kwVlibQM2SaepXmPbPS0U","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns real-time USD spot prices for up to 10 ERC-20 (Base) or SPL (Solana) tokens sourced directly from on-chain DEX pools, with confidence scores and pool metadata.","exampleAgentPrompt":"What's the current on-chain USD price of the Base token at 0x940181a94A35A4569E4529A3CDfB74e38FD98631 — include which pool was used and the confidence level?","exampleUseCases":[{"title":"DeFi portfolio valuation bot","prompt":"Price these three Base tokens for me and tell me the pool depth and confidence for each: base:0x940181a94A35A4569E4529A3CDfB74e38FD98631, base:0x4200000000000000000000000000000000000006, base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},{"title":"Solana token trade sizing","prompt":"What's the on-chain USD price of the Solana token with mint address sol:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v, and how deep is the pool liquidity — I need to know if I can move $50k without slippage issues."},{"title":"Cross-chain arbitrage monitor","prompt":"Check the live on-chain USD prices for both the Base and Solana versions of USDC right now — base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 and sol:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v — and tell me which pool each is sourced from."}],"resultDescription":"Returns a JSON array of per-token results, each containing: priceUsd (nullable if below depth floor), confidence level (high/low/null), the pool used (DEX name, quote token, pool address, fee tier, depth in USD), the pricing path (direct USDC or routed via WETH/SOL), and any warnings. Also includes a top-level asOf timestamp with block/slot numbers, and metadata about which DEXes and depth thresholds were applied. Prices below $1,000 pool depth are suppressed (null).","failureModes":["400 error returned before payment if token address format is invalid or chain prefix is wrong — not charged","priceUsd returns null if pool depth is below $1,000 USD floor","Low confidence warning if pool depth is below configured threshold","Token not found in any supported pool returns null price with warning","Up to 10 tokens per call — exceeding limit causes 400 error","Spot price only — no TWAP, so subject to manipulation on low-liquidity tokens"],"whenToPreferThis":"Choose this endpoint when you need raw on-chain token prices without relying on a centralized price feed like CoinGecko or Chainlink. Ideal for AI agents operating in DeFi contexts on Base or Solana that need trustless, DEX-sourced prices with pool provenance and confidence metadata. Best when you need to audit exactly which pool and fee tier the price comes from, or when pricing long-tail tokens not covered by major oracles. Pay-per-call model ($0.003 USDC) suits low-frequency or exploratory use cases.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-30T18:34:27.902Z","isFirstParty":false,"canonicalSlug":"1gateway-on-chain-token-price-api-3a545c24"}