getMuonUpnlB
Fetch a fresh Muon uPnl_B attestation for partyB against partyA and normalize it to typed fields — the partyB’s uPnL is computed against the given partyA (used in lockQuote solvency validation). The oracle URLs and the SYMMIO diamond address are resolved from config; gateways are tried in order until one succeeds.
import { getMuonUpnlB } from "@symmio/trading-core";
const b = await getMuonUpnlB(config, { partyB: "0xpb...", partyA: "0xva..." });
console.log(b.uPnl, b.quoteIds);Parameters
partyBAddressrequiredThe partyB (a hedger/solver) to attest.
partyAAddressrequiredThe partyA the partyB’s uPnL is computed against.
chainIdnumberoptionalOptional chain override.
Returns
GetMuonUpnlBReturnTypepartyBAddressThe attested partyB.
partyAAddressThe partyA the attestation is computed against.
uPnlbigintrequiredSigned unrealized PnL (18-decimal, signed).
notionalValueSumbigintoptionalSum of notional values across the partyB’s positions with the partyA.
quoteIdsbigint[]Quote ids included in the attestation.
Plus the MuonAttestationBase signature envelope fields.
Query options
import { getMuonUpnlBQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getMuonUpnlBQueryOptions(config, { partyB, partyA }));GetMuonUpnlBOptions requires partyB and partyA; the factory does not accept missing inputs or validate them inside queryFn. The getMuonUpnlBQueryKey builder still accepts partial inputs for cache matching and invalidation.