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
partyBAddressrequiredThe partyB (solver) side of the attestation.
partyAAddressrequiredThe partyA (virtual account, lowcap) to attest.
symbolIdbigintrequiredThe symbol id whose price is included in the attestation.
chainIdnumberoptionalOptional chain override.
Returns
GetMuonUpnlWithSymbolPriceReturnTypepartyBAddressThe attested partyB.
partyAAddressThe attested partyA.
symbolIdbigintThe symbol id the price is for.
pricebigintoptionalThe attested symbol price (18-decimal).
uPnlAbigintoptionalSigned unrealized PnL for partyA (18-decimal, signed).
uPnlBbigintoptionalSigned 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.