Skip to Content
Symmio Trading-SDK — the SDK surface for builders on HyperEVM
CoreMuon OraclegetMuonUpnlWithSymbolPrice

getMuonUpnlWithSymbolPrice

Fetch a fresh Muon uPnlWithSymbolPrice attestation for a partyB / partyA pair and a symbolId, normalized to typed fields. This attestation carries both parties’ uPnL plus a single symbol price — the shape a solver’s openPosition call needs. The oracle URLs and the SYMMIO diamond address are resolved from config; gateways are tried in order until one succeeds.

import { getMuonUpnlWithSymbolPrice } from "@symmio/trading-core"; const a = await getMuonUpnlWithSymbolPrice(config, { partyB: "0xsolver...", partyA: "0xva...", symbolId: 1n, }); console.log(a.price, a.uPnlA, a.uPnlB);

Parameters

partyBAddressrequired

The partyB (solver) side of the attestation.

partyAAddressrequired

The partyA (virtual account, lowcap) to attest.

symbolIdbigintrequired

The symbol id whose price is included in the attestation.

chainIdnumberoptional

Optional chain override.

Returns

GetMuonUpnlWithSymbolPriceReturnType
partyBAddress

The attested partyB.

partyAAddress

The attested partyA.

symbolIdbigint

The symbol id the price is for.

pricebigintoptional

The attested symbol price (18-decimal).

uPnlAbigintoptional

Signed unrealized PnL for partyA (18-decimal, signed).

uPnlBbigintoptional

Signed unrealized PnL for partyB (18-decimal, signed).

quoteIdsAbigint[]

Quote ids included on partyA’s side of the attestation.

quoteIdsBbigint[]

Quote ids included on partyB’s side of the attestation.

Plus the MuonAttestationBase signature envelope fields.

Query options

import { getMuonUpnlWithSymbolPriceQueryOptions } from "@symmio/trading-core"; import { useQuery } from "@tanstack/react-query"; useQuery(getMuonUpnlWithSymbolPriceQueryOptions(config, { partyB, partyA, symbolId }));

GetMuonUpnlWithSymbolPriceOptions requires partyB, partyA, and symbolId; the factory does not accept missing inputs or validate them inside queryFn. The getMuonUpnlWithSymbolPriceQueryKey builder still accepts partial inputs for cache matching and invalidation.

Last updated on