Functions
glosso_price(symbol)
Fetch the current price for a supported token.
Script: tsx scripts/price.ts <symbol>
| Parameter | Type | Description |
|---|---|---|
symbol | string | Token symbol (case-insensitive) |
SOL, BTC, ETH, USDC, USDT, JUP, BONK, WIF, PYTH, JTO
Returns:
| Field | Description |
|---|---|
price | Current price in USD |
confidence | Pyth confidence interval (± USD) |
expo | Price exponent from Pyth (for raw calculations) |
ts | Unix timestamp of the price |
publishTime | ISO timestamp |
Usage in Agent
Price Freshness
Pyth prices are published every 400ms by independent data providers. Theconfidence field tells you how tight the spread is. For automated trading, treat prices with confidence > 1% of the price as potentially stale market conditions.