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

getMuonUpnl

Fetch a fresh Muon uPnl attestation for a partyB / partyA pair and normalize it to typed fields. Returns the combined attestation — partyA and partyB uPnL in one response, with a per-party breakdown. For a single-party uPnL use getMuonUpnlA / getMuonUpnlB instead. The oracle URLs and the SYMMIO diamond address are resolved from config; gateways are tried in order until one succeeds.

import { getMuonUpnl } from "@symmio/trading-core"; const a = await getMuonUpnl(config, { partyB: "0xb...", partyA: "0xva..." }); console.log(a.uPnlA, a.uPnlB);

Parameters

partyBAddressrequired

The partyB (solver/hedger) side of the pair to attest.

partyAAddressrequired

The partyA (virtual account for lowcap) to attest.

chainIdnumberoptional

Optional chain override.

Returns

GetMuonUpnlReturnType
partyBAddress

The attested partyB.

partyAAddress

The attested partyA.

uPnlAbigintoptional

PartyA’s signed unrealized PnL (18-decimal, signed).

uPnlBbigintoptional

PartyB’s signed unrealized PnL (18-decimal, signed).

notionalValueSumAbigintoptional

Sum of notional values across the partyA’s positions.

notionalValueSumBbigintoptional

Sum of notional values across the partyB’s positions.

quoteIdsAbigint[]

Quote ids included in the partyA side of the attestation.

quoteIdsBbigint[]

Quote ids included in the partyB side of the attestation.

Plus the MuonAttestationBase signature envelope fields.

Query options

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

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

Last updated on