Infrastructure · Price Oracle
Real-time price intelligence for Stellar.
Lens is a unified price oracle that continuously ingests Stellar DEX trade history and AMM pool snapshots, computing VWAP, OHLCV, and optimal routing — served behind x402 micropayments with no API key required.
REST API
Five endpoints. One paywall.
/price/:assetA/:assetBAggregated price, VWAP, volume, and best route for a pair
/price/:assetA/:assetB/routeBest execution route with slippage estimate for a given amount
/price/:assetA/:assetB/historyOHLCV bucket history (1m / 5m / 1h / 24h windows)
/poolsLatest AMM pool snapshots with reserves and spot prices
/statusIndexer health — last indexed ledger and processed timestamp
Under the hood
Aggregated. Routed. Monetized.
VWAP & OHLCV
Volume-weighted average price across 1m, 5m, 1h, and 24h windows. Open, high, low, close, and volume data for any watched pair.
SDEX + AMM Ingestion
Simultaneously ingests SDEX trade history from Horizon and AMM pool snapshots in real time. Merges both sources into a unified price feed.
Best Route Routing
Given a pair and an amount, Lens computes the optimal execution route — SDEX, AMM, or SPLIT — using live reserves and constant-product formula.
x402 Pay-Per-Call
Every price endpoint is gated behind an x402 micropayment. Callers pay a small XLM fee automatically — no API keys, no subscriptions.
Low-Latency Cache
Redis-backed result cache with configurable TTL. Repeated queries within the window are served instantly with no database round-trip.
REST + GraphQL
Full REST API at /price/:assetA/:assetB plus a GraphQL endpoint for flexible data queries. Both covered by the same x402 paywall.
x402 Micropayments
No API keys.
Pay per call.
Lens uses the x402 HTTP payment protocol. When you call a price endpoint, your client automatically pays a small XLM fee on Stellar and retries — no wallet connection required, no subscription to manage.