Prices and quotes

Every mint and redemption carries its own price: a quote with a bid and an ask, signed by Ported's price service. The Issuer accepts it only if it is fresh, signed by enough registered signers, and inside a band around the last price it accepted.

A quote is a sealed letter: it names its token, its time and its price, and is opened only by the contract it was addressed to.

What a quote contains

A quote is an EIP-712 typed message. It prices one token of one deployment, so it cannot be replayed on another market, another chain or another copy of the contracts: the token is in the message, and the chain id and the price source's address are in the domain.

AttestedPriceSource.sol
struct Quote {
  address token;    // the pToken priced
  uint256 bid;      // USDC per whole token, 18 decimals: redeems
  uint256 ask;      // USDC per whole token, 18 decimals: mints
  uint64  issuedAt; // unix time the price was read
  uint64  hlBlock;  // HyperCore block it was read at (audit trail)
}

// EIP-712 typehash
Quote(address token,uint256 bid,uint256 ask,uint64 issuedAt,uint64 hlBlock)

// domain
{ name: "Ported Price", version: "2", chainId, verifyingContract: <price source> }

// priceData passed to mint / redeem
abi.encode(Quote, bytes[] signatures) // sorted by signer address, ascending
bid, ask
The token's value with a spread on each side: mints pay the ask, redeems receive the bid. Both are USDC per whole token, so they already include the token's units of exposure, not just the market price.
issuedAt
When the price was read on HyperEVM, not when it was signed, so the quote's validity counts the age of the price itself.
hlBlock
The HyperCore block the price was read at. Not checked on-chain; it lets anyone trace a quote back to the market state it came from.

How the token's value is derived from the mark price and funding is on Funding and value.

Signatures: k of n

The price source keeps a set of registered signers and a threshold. A quote counts when at least threshold of them signed exactly that message.

  • Signatures are passed sorted by the signer's address, strictly increasing. That is how the contract proves no signer is counted twice; out of order reverts with SignersNotSorted.
  • Every signature must come from a registered signer. A single unknown one reverts the quote (UnknownSigner), it is not skipped.
  • Fewer valid signatures than the threshold reverts with NotEnoughSignatures.
  • The owner adds and removes signers and sets the threshold, which can never exceed the number of signers.

Freshness

A quote is a free option on the price for as long as it is valid, so it is kept short. The owner sets maxQuoteAge, and the contract caps it.

issuedAt ≤ block.timestamp + 5 block.timestamp ≤ issuedAt + maxQuoteAge 0 < maxQuoteAge ≤ 30
MAX_QUOTE_AGE_CAP = 30 seconds, MAX_CLOCK_SKEW = 5 seconds, both constants in the contract.

The skew allows for a signer's clock running slightly ahead of the chain (QuoteFromFuture beyond it). An expired quote reverts with QuoteTooOld. There is no rule that quotes must arrive in time order: an older valid quote is still accepted, so a tiny trade with the newest quote cannot make everyone else's transactions fail.

The price band

Each market keeps an anchor: the last bid the Issuer accepted, and when. Every price a trade uses must sit within a band around it. The band starts at maxMoveBps and widens by maxMoveBpsPerMinute for every whole minute since the anchor was set, up to 100%.

minutes = (now − anchorAt) / 60 (rounded down) allowed = min(maxMoveBps + minutes × maxMoveBpsPerMinute, 10000) |price − anchor| × 10000 ≤ anchor × allowed
Both parameters are set per market by the owner, under hard caps: MAX_MOVE_BPS = 2000 (20%), MAX_MOVE_BPS_PER_MINUTE = 500 (5%).
Mints
Both the bid and the ask must be inside the band.
Redeems
Only the bid. Redemptions can always use a redeem-only quote.
Violation
Reverts with PriceOutOfBand(price, anchor, allowedBps). You can read the current width with allowedMoveBps(perpIndex).

The band exists to stop a wrong price, not a real move. A quiet market lets it widen; an active one keeps resetting it around the current price.

How the anchor moves

After a trade's prices pass the band, the anchor moves to that quote's bid, but at most once a minute: if the anchor was set less than 60 seconds ago it stays where it is. Many trades in one block or one minute therefore all sit in the same band and cannot walk it further.

TimeEventBandAnchor after
12:00:00Trade, bid $3,668—$3,668 (set)
12:00:40Trade, bid $3,67120% (0 minutes)$3,668 (under a minute, unchanged)
12:01:10Trade, bid $3,67525% (1 minute)$3,675 (moved)
12:21:10No trade for 20 minutes100% (capped)$3,675
With pGOLD's live settings: 20% plus 5% per minute.

The worst a compromised signer set can do is drag the anchor by the band's width once a minute. Combined with the hourly flow limits and the debt limit, that bounds how much value a bad price can extract from any one market before the guardian pauses it.

Keeping the anchor current

pokePrice(perpIndex, priceData)
Anyone may call it with a valid quote. It runs the same checks as a redemption (bid inside the band) and moves the anchor under the same once-a-minute rule. It lets the band follow the market between trades.
resetReferencePrice(perpIndex, priceData)
Guardian or owner only. Sets the anchor to a valid quote's bid ignoring the band: at launch, and after a real gap larger than the band has caught up with, such as a halt or a market reopening. It still needs a fresh, properly signed quote.

Neither works on a wound-down market, which no longer uses quotes. A market without an anchor rejects every trade with NoReferencePrice.

Redeem-only quotes

When a market cannot take new exposure, for instance while its hedge has no margin to grow, the price service still serves quotes, but redeem-only ones: a real bid and an ask set at 100 times the bid. A mint with such a quote fails the band check on its ask, while a redemption, which checks only the bid, goes through as usual.

The site reads the quote's mode and closes the mint side with a short note; redemptions stay open.

Other checks

  1. 1
    bid ≤ ask, bid > 0Checked by the price source (InvalidPrices) and again by the Issuer (InvalidQuote), so a future source cannot skip it.
  2. 2
    Debt at the higher priceOn a mint the market's supply is valued at the higher of the ask and the anchor before the trade. A walked-down ask cannot make a large supply look small to the debt limit.
  3. 3
    Right tokenA quote for another token reverts with WrongToken.

When Elysium reads Hyperliquid natively

Signed quotes are a stand-in. Elysium is expected to gain a precompile that reads Hyperliquid's state directly; once it does, a price source that reads the mark and funding on-chain can replace the signers.

The Issuer only knows the IPriceSource interface, one function that returns a bid, an ask and a time for a token, or reverts. Moving to native prices is a call to setPriceSource with a new adapter: the Issuer, the tokens and the USDC they hold stay where they are. Nothing is migrated.

Native prices also let mint and redeem run inside a Uniswap v4 hook, since a swap can then be priced without a quote attached. See Minting and redeeming through a pool.

IPriceSource.sol
function quote(address token, bytes calldata data)
  external view returns (uint256 bid, uint256 ask, uint64 issuedAt);