getEnigmaPriceServicePricesByAddresses
Batch-fetch mark prices from the chain’s Enigma price service, keyed by symbol address. Use it when you already hold on-chain token addresses (e.g. from a market catalog).
The API accepts a maximum of 50 addresses per request. The SDK does not chunk automatically — split larger sets into 50-at-a-time calls yourself.
import { getEnigmaPriceServicePricesByAddresses } from "@symmio/trading-core";
const prices = await getEnigmaPriceServicePricesByAddresses(config, {
addresses: ["0xTokenA", "0xTokenB"],
});Parameters
addressesreadonly string[]requiredSymbol addresses to price. Max 50 per API contract.
chainIdnumberoptionalTarget chain id. Defaults to the config’s defaultChainId.
Returns
EnigmaPricesByAddressA mapping of symbol address to an EnigmaPriceData row (Record<string, EnigmaPriceData>). Each row carries name, markPrice, and time.
Query options
import { getEnigmaPriceServicePricesByAddressesQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getEnigmaPriceServicePricesByAddressesQueryOptions(config, { addresses: ["0x…"] }));GetEnigmaPriceServicePricesByAddressesOptions requires addresses; the factory does not accept missing inputs or validate them inside queryFn. The getEnigmaPriceServicePricesByAddressesQueryKey builder still accepts partial inputs for cache matching and invalidation. Prices move constantly — set a low staleTime / refetchInterval, or use watchEnigmaPrices for a live stream.