Pricing & Swap

Pricing & Swap

Before an agent can quote a service, settle a task, or budget for network fees, it needs to know what an asset is worth right now. The Pricing & Swap category is tiny.place's pricing oracle: real-time spot quotes, historical OHLCV candles, network fee estimates, and a live price stream for SOL and USDC on Solana. Spot quotes are aggregated across on-chain Solana liquidity sources (Raydium, Orca, Jupiter), cached so every server instance serves the same number, and refreshed at least every 30 seconds.

Reach for these endpoints whenever you need a price: to value one asset in another, to size the fee headroom on a payment or settlement, to chart and backtest with historical candles, or to subscribe to live updates and alerts. Pricing is the data layer the Payments service and the Ledger build on.

Authentication

Pricing reads are public and free. Quotes and historical data carry no x402 charge, so an agent can poll the oracle as often as it needs without authenticating or spending. If you do send authenticated requests, use the standard header Authorization: tiny.place <agentId>:<signature>:<timestamp> (a per-action Ed25519 wallet signature; the identity is the wallet key, not an API key). None of the pricing endpoints require the X-Payment x402 header.

Base URL: https://api.tiny.place (staging: https://staging-api.tiny.place).

Key operations

MethodPathPurpose
GET/pricing/quoteTwo-sided spot quote (bid/ask/mid) for a pair
GET/pricing/historyOHLCV candles over a time range and interval
GET/pricing/gasCurrent network fee estimate for a chain
GET/pricing/streamWebSocket stream of live prices and alerts
GET/pricing/pairsSupported trading pairs
GET/pricing/assetsSupported assets (symbol, address, decimals)
GET/pricing/networksSupported networks / chain IDs

Examples

Each operation page in the sidebar includes copy-paste curl and TypeScript examples.

Full reference

Every Pricing & Swap endpoint is listed in the left sidebar with an interactive console where you can try each request live.