getSendQuoteUpnlSig
Fetch a fresh Muon uPnl_A_withSymbolPrice attestation, assembled into the contract-ready SingleUpnlAndPriceSig that sendQuoteWithAffiliateAndData takes as its upnlSig argument. Solvers that enforce Muon verification (majors) require a live attestation here; the lowcap InstantLayer flow instead signs a placeholder and delegates the byte range to the solver, so it does not call this. For the raw, un-assembled attestation (all returned fields), use getMuonUpnlAWithSymbolPrice instead. The oracle URLs and the SYMMIO diamond address are resolved from config; gateways are tried in order until one succeeds.
The attestation is timestamped, short-lived, and signed inside the quote calldata — fetch it immediately before signing, never ahead of time and never from cache.
import { getSendQuoteUpnlSig } from "@symmio/trading-core";
const upnlSig = await getSendQuoteUpnlSig(config, {
partyA: subAccountAddress,
symbolId: 1n,
});Parameters
partyAAddressrequiredThe Muon partyA to attest. For cross-margin solvers this is the sub-account; for lowcap it is the virtual account.
symbolIdbigintrequiredMarket symbol id whose price is attested alongside the uPnL.
chainIdnumberoptionalOptional chain override.
Returns
Like getDeallocateUpnlSig, this returns a contract-ready struct — not a MuonAttestationBase subtype. It mirrors the on-chain SingleUpnlAndPriceSig tuple field-for-field so it encodes directly as the contract argument. Compare SingleUpnlSig, which is the uPnL-only variant with no price.
SingleUpnlAndPriceSigreqIdHexMuon request id (opaque bytes).
timestampbigintAttestation timestamp (seconds).
upnlbigintSigned unrealized PnL of the party, int256 (may be negative).
pricebigintAttested symbol price as 18-decimal fixed point. Falls back to 0n when the gateway omits it.
gatewaySignatureHexMuon gateway signature over the request (opaque bytes).
sigsSchnorrSignThe Schnorr TSS signature pieces (signature, owner, nonce).
Query options
import { getSendQuoteUpnlSigQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getSendQuoteUpnlSigQueryOptions(config, { partyA, symbolId }));GetSendQuoteUpnlSigOptions requires both partyA and symbolId; the factory does not accept missing inputs or validate them inside queryFn. The getSendQuoteUpnlSigQueryKey builder still accepts partial inputs for cache matching and invalidation. Caching is only appropriate for display — a cached signature is never valid to sign a quote with.