Skip to Content
Symmio Trading-SDK — the SDK surface for builders on HyperEVM
CorePrice ServiceOverview

Price Service

Off-chain market data — mark prices, symbol metadata, and health — from the chain’s configured price service. HyperEVM uses Enigma, the lowcap price source (config.getChainConfig().priceService.type === "enigma").

The service exposes two access modes, both wrapped by @symmio/trading-core:

  • REST reads — one-shot batch fetches for prices, metadata, the symbol catalog, and health. Reach for these on review screens, one-off checks, and pre-trade preflight.
  • WebSocket streamwatchEnigmaPrices pushes live tick batches. Use it when the UI needs continuously updating prices (order book, PnL, live trade panels). The endpoint is broadcast-only and one socket is pooled across every subscriber for the same chain.

Endpoint URLs live in the chain config:

const chain = config.getChainConfig(); chain.priceService.url; // REST base URL chain.priceService.wsUrl; // WebSocket URL (used by watchEnigmaPrices)

Each method and type has its own page with the full signature, parameters, return shape, examples, and query options.

Live prices

REST reads

Types

Query options

Each REST read ships a matching …QueryOptions factory and a …QueryKey builder for TanStack Query. See each read’s page for the exact call, and Query options for the shared pattern. Prices tick constantly — cache them with a low staleTime or a refetchInterval, or prefer the WebSocket stream for anything live. watchEnigmaPrices is a subscription, not a query — it has no query options.

Errors

REST failures surface as SymmApiError; the stream surfaces transport/parse issues on onError.

  • FETCH_ENIGMA_PRICE_SERVICE_PRICES_BY_ADDRESSES_FAILEDgetEnigmaPriceServicePricesByAddresses.
  • FETCH_ENIGMA_PRICE_SERVICE_PRICES_BY_NAMES_FAILEDgetEnigmaPriceServicePricesByNames.
  • FETCH_ENIGMA_PRICE_SERVICE_METADATA_FAILEDgetEnigmaPriceServiceMetadata.
  • FETCH_ENIGMA_PRICE_SERVICE_SYMBOLS_INFO_FAILEDgetEnigmaPriceServiceSymbolsInfo.
  • FETCH_ENIGMA_PRICE_SERVICE_HEALTH_FAILEDgetEnigmaPriceServiceHealth.
  • PRICES_WS_NOT_CONFIGUREDwatchEnigmaPrices, thrown synchronously when the chain has no priceService.wsUrl.
  • PRICES_SOCKET_ERRORwatchEnigmaPrices, surfaced on onError per parse/transport failure; the subscription stays open.
  • React price-service hooksuseEnigmaPrices, useEnigmaPriceServiceMetadata, and the rest of the thin hooks over these actions.
  • WebSocket streams — pool, reconnect, and the SocketStatus lifecycle.
  • Solvers — lowcap markets whose prices come from this feed, not an on-chain book.
  • TP/SL — conditional orders that trigger off these prices.
Last updated on