Addresses
@symmio/trading-core ships a per-chain registry of every deployment address, endpoint URL, and configured service. It lives in the core package at:
packages/trading-core/src/core/chains/registry.tsThe registry is the single source of truth for chain-specific values. Every action reads it via Config.getChainConfig(chainId) — you never hand-thread addresses through action arguments unless you’re overriding a default.
Runtime access
import { createConfig, SymmioSupportedChainId } from "@symmio/trading-core";
const config = createConfig({
symmioConfig: {
[SymmioSupportedChainId.HYPER_EVM]: { addresses: { affiliatesAddress: "0xYourRegisteredAffiliate…" } },
},
getClient: () => publicClient,
});
const chain = config.getChainConfig(999);
chain.addresses.symmioAddress;
chain.addresses.instantLayerAddress;
chain.addresses.accountLayerAddress;
chain.addresses.affiliatesAddress;
chain.addresses.collateralAddress;
chain.addresses.collateralDecimals;Throws UNSUPPORTED_CHAIN when the chain id isn’t in the registry. See Config.
What’s in the registry
Every entry is a SymmioChainConfig — the fully-resolved settings for one chain:
chainIdnumberNumeric chain id (e.g. 999 for HyperEVM).
addressesSymmioContractAddressesOn-chain contract addresses (detailed below).
subgraphsSymmioSubgraphUrlsGraphQL endpoints — analytics and events.
solverSymmioSolverConfigSolver / hedger REST API and TP/SL handler.
priceServiceSymmioPriceServiceConfigEnigma price service (REST + WebSocket).
notificationsSymmioNotificationsConfigSolver notifications WebSocket + REST search.
muonSymmioMuonConfigMuon oracle gateway URLs.
The addresses field — the section people usually want:
symmioAddressAddressSYMMIO diamond contract.
instantLayerAddressAddressInstantLayer (delegated instant actions).
accountLayerAddressAddressAccountLayer (SubAccount / VA management).
affiliatesAddressAddressYour frontend’s affiliate identity (fee attribution). Required per chain via createConfig’s
symmioConfig[chainId].addresses.affiliatesAddress — the field must be present (createConfig throws when it
is missing). The zero address is accepted as a no-affiliate test placeholder; `
register your affiliate to earn a share of the trading fees.
collateralAddressAddressCollateral token (e.g. USDC).
collateralDecimalsnumberDecimals of the collateral token.
Everything else (solver URL, TP/SL handler, subgraph, notifications WS, Muon gateways) lives on the sibling fields above.
Current chains
Only HyperEVM (999) is deployed today. The registry entry (packages/trading-core/src/core/chains/registry.ts:10-60) carries:
symmioAddress—0x57331038c21982116EE9b0906E4a5c5cB52dcE2einstantLayerAddress—0x72DBF07457b2712b160F67A85D338F860c1CA620accountLayerAddress—0x46493c376758Da47823D7E3Ae5d417eA6546eEB3affiliatesAddress—0xBcB033C9154401fA000a1Ae60843f79f45741b7c(built-in default; override it per chain via the requiredsymmioConfig[chainId].addresses.affiliatesAddress— set your registered affiliate to earn a share of the trading fees)collateralAddress—0xb88339CB7199b77E23DB6E890353E22632Ba630f(USDC, 6 decimals)solver.address—0x76bc5889c0cfcC20960b0D81F541595d81a95122(Enigma)solver.tpsl.cohWalletAddress—0xf2afbb3f13Ca72bfb69749f3bC5EbD6528b1fc31
Plus URLs for solver, TP/SL handler, price service, notifications, subgraphs, and Muon gateways.
Per-chain overrides
Override any field at runtime via createConfig({ symmioConfig }). Deep-merged onto the built-in registry — you can override just the subgraph URL or just one address, keeping the rest.
const config = createConfig({
getClient: () => publicClient,
symmioConfig: {
999: {
addresses: { affiliatesAddress: "0xYourRegisteredAffiliate…" },
subgraphs: {
analytics: "https://staging.example/subgraphs/analytics",
},
},
},
});Useful for staging deployments and new chains that ship before an SDK release.
Adding a chain
- Add its id to
packages/trading-core/src/core/chains/supported-chains.ts— sourced fromviem/chains, never a numeric literal. - Add its entry to
CHAIN_CONFIGSinpackages/trading-core/src/core/chains/registry.ts— every field ofSymmioChainConfigis required. - Colocate tests for
getChainConfigif you introduce novel behavior.
Open a PR. New chains follow the existing entries’ conventions.
Related
- Config — how
getChainConfig/symmioConfigplug in. - ABI fragments — pair addresses with typed ABIs for viem-direct calls.
- Shared Types —
ChainIdParametermixin on every action.