getForceClosePriceSig
Fetch a fresh Muon priceRange attestation for a time window, assembled into the contract-ready HighLowPriceSig that forceClosePosition / settleAndForceClosePosition verify — the proof that the market traded through the position’s close price during the window. For the raw, un-assembled attestation (all returned fields), use getMuonPriceRange 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 and short-lived — fetch it immediately before submitting, not ahead of time.
import { getForceClosePriceSig } from "@symmio/trading-core";
const sig = await getForceClosePriceSig(config, {
partyA,
partyB: solverAddress,
symbolId: 1n,
t0: windowStart,
t1: windowEnd,
});Parameters
t0bigintrequiredWindow start timestamp (unix seconds).
t1bigintrequiredWindow end timestamp (unix seconds).
partyAAddressrequiredPartyA of the position being force-closed.
partyBAddressrequiredPartyB (the solver) of the position being force-closed.
symbolIdbigintrequiredMarket symbol id of the position.
chainIdnumberoptionalOptional chain override.
Returns
A contract-ready struct mirroring the on-chain HighLowPriceSig tuple field-for-field, so it encodes directly as the contract argument.
Three of the wire names differ from the struct’s: Muon returns mean for averagePrice, price for currentPrice, and uPnlB / uPnlA for upnlPartyB / upnlPartyA. Note also that upnlPartyB is declared before upnlPartyA — swapping them type-checks green and silently mis-encodes the call.
HighLowPriceSigreqIdHexMuon request id (opaque bytes).
timestampbigintAttestation timestamp (seconds).
symbolIdbigintSymbol id the price range is for.
highestbigintHighest price observed in the window, 18-decimal fixed point.
lowestbigintLowest price observed in the window, 18-decimal fixed point.
averagePricebigintMean price over the window, 18-decimal fixed point.
startTimebigintWindow start timestamp (seconds).
endTimebigintWindow end timestamp (seconds).
upnlPartyBbigintPartyB’s signed unrealized PnL, int256. Declared before upnlPartyA.
upnlPartyAbigintPartyA’s signed unrealized PnL, int256.
currentPricebigintCurrent price at attestation time, 18-decimal fixed point.
gatewaySignatureHexMuon gateway signature over the request (opaque bytes).
sigsSchnorrSignThe Schnorr TSS signature pieces (signature, owner, nonce).
Query options
import { getForceClosePriceSigQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getForceClosePriceSigQueryOptions(config, { partyA, partyB, symbolId, t0, t1 }));GetForceClosePriceSigOptions requires every action input; the factory does not accept missing inputs or validate them inside queryFn. The getForceClosePriceSigQueryKey builder still accepts partial inputs for cache matching and invalidation. Because the signature is short-lived, prefer fetching on demand right before the write over serving a cached one.