Muon oracle
Muon is a decentralized oracle network. SYMMIO uses it to attest to prices, unrealized-PnL (uPnL) values, and account overviews that the contract will only accept when signed by a trusted quorum (removeMargin / deallocate, settlement, force-close, liquidation).
@symmio/trading-core exposes each documented Muon endpoint as its own typed read. Every method resolves the oracle gateway URLs and the SYMMIO diamond address (the symmio request param) from config, tries the configured gateways in order until one succeeds, and returns a normalized attestation — typed bigint / Address fields plus the shared signature envelope. The raw envelope fields common to every return are documented once on MuonAttestationBase.
Each method has its own page with the full signature, parameters, return shape, examples, and query options.
Prices
Validated prices for a set of quote ids.
getMuonPriceRangeTWAP-style price range over a time window for force-close validation.
uPnL attestations
Combined partyA + partyB unrealized PnL in one attestation.
getMuonUpnlAA partyA’s unrealized-PnL attestation.
getMuonUpnlBA partyB’s unrealized PnL computed against a partyA.
getMuonUpnlWithSymbolPriceBoth parties’ uPnL plus a single symbol price.
getMuonUpnlAWithSymbolPriceA partyA’s uPnL plus a single symbol price.
getMuonSettleUpnlA partyA’s uPnL settlement data for a set of quotes.
getMuonPartyAOverviewA partyA’s liquidation overview.
Contract signatures
Types
Query options
Each read ships a matching …QueryOptions factory and a …QueryKey builder for TanStack Query. See each method’s page for the exact call, and Query options for the shared pattern. Attestations are timestamped and short-lived — cache them with a low staleTime, and for a signature you intend to submit on-chain fetch a fresh one on demand rather than serving a cached one.
Errors
MUON_URLS_NOT_CONFIGURED— the chain has no Muon gateway URLs in its config. Surfaces as aSymmErrorwithkind: "config".MUON_REQUEST_UNSUCCESSFUL— a gateway responded but the attestation was unsuccessful (quorum failure, invalid request). Surfaces as aSymmErrorwithkind: "api".FETCH_MUON_REQUEST_FAILED— every configured gateway failed at the transport / HTTP layer. Surfaces as aSymmApiError(kind: "api") carrying the last transport error.
Related
- SYMMIO Contract — writes that consume Muon attestations (
removeMargin, settle, force-close). - AccountLayer —
removeMargin/deallocate, which needgetDeallocateUpnlSig. - Errors — the full
SymmErrorcatalogue.