Skip to Content
Symmio Frontier — the SDK surface for builders on HyperEVM
CoreOverview

Core

@symmio/trading-core is the framework-agnostic SYMMIO SDK. Contract calls, REST clients, GraphQL subgraph reads, WebSocket streams, calculations, and typed errors — no framework assumptions.

Framework layers (@symmio/trading-react, a future Vue layer) sit on top of core and inject the viem-client resolvers it needs.

Install

pnpm add @symmio/trading-core viem

viem is the only peer dependency — bring your own copy.

Shape

Every read is getXyz(config, params); every write is xyz(config, params). The config is always the first argument — a single immutable Config object created once with createConfig, shared across every call.

import { createConfig, getUserSubAccounts } from "@symmio/trading-core"; import { createPublicClient, http } from "viem"; import { hyperEvm } from "viem/chains"; const publicClient = createPublicClient({ chain: hyperEvm, transport: http() }); const config = createConfig({ getClient: () => publicClient, }); const subs = await getUserSubAccounts(config, { user: "0xabc..." });

Every read also ships a matching getXyzQueryOptions(config, options) factory returning a fully-formed TanStack Query options bag — feed it into useQuery or queryClient.fetchQuery.

See Config and Query options.

Core Concepts

Cross-cutting mental model referenced by every slice.

  • ConfigcreateConfig, injected client resolvers, chain overrides, WebSocket constructor.
  • Query Options — the getXyzQueryOptions / xyzMutationOptions factory pattern.
  • Query Keys — key shape, filterQueryOptions, predicateMatch invalidation.
  • WebSocket StreamsSocketStatus, reconnect, connection pool.
  • ErrorsSymmError / SymmApiError catalogue, viem pass-through.

Reference

Every domain slice, one page. Each page follows the same anatomy — purpose → import → per-action signature + params + returns + example → related.

Contracts

  • ABI fragments — raw viem Abi arrays for the escape hatch.
  • Addresses — per-chain contract address registry.
  • AccountLayer — SubAccount / Virtual Account creation, deposits, margin management.
  • InstantLayer — delegation reads + grantDelegation.
  • SYMMIO Contract — markets, quotes, collateral, allocation, withdraw against the Symmio contract.

Trading

Data

  • Price Service — Enigma mark prices, metadata, health, live stream.
  • Notifications — solver notifications stream (watchNotifications) + REST history (searchNotifications).
  • Subgraph — balance history, transfers, quote history, quote events, quote funding.
  • Muon Oracle — UPNL / price / range signature helpers for on-chain writes that need Muon attestations.

Types

  • Shared TypesChainIdParameter, ConfigParameter, QueryParameter, SymmioQueryOptions, WebSocket types, TS helpers.

What core doesn’t do

Last updated on