getMuonSettleUpnl
Fetch a fresh Muon settle_upnl attestation for partyA over quoteIds and normalize it to typed fields. This produces the uPnL settlement data that settleUpnl requires. The oracle URLs and the SYMMIO diamond address are resolved from config; gateways are tried in order until one succeeds.
import { getMuonSettleUpnl } from "@symmio/trading-core";
const s = await getMuonSettleUpnl(config, { partyA: "0xva...", quoteIds: [10n, 11n] });
console.log(s.uPnlA, s.quoteIds);Parameters
partyAAddressrequiredThe partyA (virtual account for lowcap) whose quotes to settle.
quoteIdsreadonly bigint[]requiredQuote ids to include in the settlement attestation.
chainIdnumberoptionalOptional chain override.
Returns
GetMuonSettleUpnlReturnTypepartyAAddressThe attested partyA.
quoteIdsbigint[]Quote ids included in the attestation.
uPnlAbigintoptionalSigned unrealized PnL for partyA (18-decimal, signed).
notionalValueSumAbigintoptionalSum of notional values across partyA’s settled positions.
Plus the MuonAttestationBase signature envelope fields.
Query options
import { getMuonSettleUpnlQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getMuonSettleUpnlQueryOptions(config, { partyA, quoteIds: [10n, 11n] }));GetMuonSettleUpnlOptions requires partyA and quoteIds; the factory does not accept missing inputs or validate them inside queryFn. The getMuonSettleUpnlQueryKey builder still accepts partial inputs for cache matching and invalidation.