Skip to Content
Symmio Trading-SDK — the SDK surface for builders on HyperEVM
CoreMuon OraclegetMuonPriceRange

getMuonPriceRange

Fetch a fresh Muon priceRange attestation for a position over the [t0, t1] window and normalize it to typed fields. This produces the TWAP-style range a partyB needs to validate a forceClosePosition / settleAndForceClosePosition against the configured gap thresholds — it is a time window in unix seconds, not a block range. The oracle URLs and the SYMMIO diamond address are resolved from config; gateways are tried in order until one succeeds.

import { getMuonPriceRange } from "@symmio/trading-core"; const r = await getMuonPriceRange(config, { t0: 1_700_000_000n, t1: 1_700_000_900n, partyA: "0xva...", partyB: "0xpb...", symbolId: 1n, }); console.log(r.lowest, r.highest, r.mean);

Parameters

t0bigintrequired

Window start in unix seconds.

t1bigintrequired

Window end in unix seconds.

partyAAddressrequired

The partyA (virtual account for lowcap) to attest.

partyBAddressrequired

The partyB counterparty of the position.

symbolIdbigintrequired

The market symbol id the range is computed for.

chainIdnumberoptional

Optional chain override.

Returns

GetMuonPriceRangeReturnType
partyAAddress

The attested partyA.

partyBAddress

The attested partyB.

symbolIdbigint

The market symbol id the range was computed for.

startTimebigintoptional

Window start in unix seconds (echoed by the gateway).

endTimebigintoptional

Window end in unix seconds (echoed by the gateway).

lowestbigintoptional

Lowest observed price across the window (18-decimal).

highestbigintoptional

Highest observed price across the window (18-decimal).

meanbigintoptional

TWAP/mean price across the window (18-decimal).

pricebigintoptional

Spot price at the attestation (18-decimal).

uPnlAbigintoptional

PartyA’s unrealized PnL at the attestation (18-decimal, signed).

uPnlBbigintoptional

PartyB’s unrealized PnL at the attestation (18-decimal, signed).

Plus the MuonAttestationBase signature envelope fields.

Query options

import { getMuonPriceRangeQueryOptions } from "@symmio/trading-core"; import { useQuery } from "@tanstack/react-query"; useQuery(getMuonPriceRangeQueryOptions(config, { t0, t1, partyA, partyB, symbolId }));

GetMuonPriceRangeOptions requires t0, t1, partyA, partyB, and symbolId; the factory does not accept missing inputs or validate them inside queryFn. The getMuonPriceRangeQueryKey builder still accepts partial inputs for cache matching and invalidation.

Last updated on