getMuonUpnlA
Fetch a fresh Muon uPnl_A attestation for partyA and normalize it to typed fields. This returns the raw attestation; for the contract-ready SingleUpnlSig that removeMargin needs, use getDeallocateUpnlSig instead. The oracle URLs and the SYMMIO diamond address are resolved from config; gateways are tried in order until one succeeds.
import { getMuonUpnlA } from "@symmio/trading-core";
const a = await getMuonUpnlA(config, { partyA: "0xva..." });
console.log(a.uPnl, a.quoteIds);Parameters
partyAAddressrequiredThe partyA (virtual account for lowcap) to attest.
chainIdnumberoptionalOptional chain override.
Returns
GetMuonUpnlAReturnTypepartyAAddressThe attested partyA.
uPnlbigintrequiredSigned unrealized PnL (18-decimal, signed).
notionalValueSumbigintoptionalSum of notional values across the partyA’s positions.
symbolIdsbigint[]Symbol ids included in the attestation.
quoteIdsbigint[]Quote ids included in the attestation.
Plus the MuonAttestationBase signature envelope fields.
Query options
import { getMuonUpnlAQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getMuonUpnlAQueryOptions(config, { partyA }));GetMuonUpnlAOptions requires partyA; the factory does not accept missing inputs or validate them inside queryFn. The getMuonUpnlAQueryKey builder still accepts partial inputs for cache matching and invalidation.