Skip to content

Price proofs

A Montra coin’s market reads its pool’s price at the end of a past second, and that price reaches the market as a price proof: block headers and a storage proof that anyone can fetch from an Elysium node and post on chain. The contracts check every proof against Elysium’s own block hashes, so a posted price is the pool’s real state at that moment, whoever posted it. No signer is involved.

A ticket committed in second c fills at the pool’s price at the end of second c + 1: the pool’s state after the last block stamped at or before c + 1. That is the Montra form of the first reading after its commit, and it is fixed the moment the ticket is committed. Sagitta’s prover posts it as soon as that second ends, so a ticket fills in about 2 to 3 seconds.

Who proves the price, and when, never changes it: there is one end of each second, and only its true state can be proven. The ticket fills at the side’s NAV right after that price’s move, before any later price applies.

For second τ, a proof names block b, the last block whose timestamp is at most τ, and its child b + 1:

  1. Both block headers. V4StateRoots checks that b + 1 is b’s child, that b is stamped at or before τ and b + 1 after it, and that b + 1’s hash is the one the chain itself reports: from the ArbSys precompile for the last 256 blocks, and from the EIP-2935 block-hash history beyond that.
  2. An account proof of the Uniswap v4 PoolManager at block b. It gives the PoolManager’s storage root at the end of second τ, which is stored for that second.
  3. A storage proof of the pool’s price word under that root. The pool’s oracle, a V4PoolOracle, checks it and stores the pool’s price and tick for second τ, with its poster.

One stored root serves every pool for that second, and one proven price serves every ticket of that second in every market on the pool. The first valid proof of a second stands and is never replaced. Nothing is read live from the pool, its reserves or its balances. The burn’s grid readings are proven the same way.

A push undone within the same transaction, or within the same second, never reaches a proven price: a second’s price is its last block’s final state, and a block can only be proven once the block after it exists. A push held across the end of a second does reach that second’s price, and that is part of the game (see Why held pushes count).

  • Idle markets. With no ticket waiting, a trade or a poke applies the newest proven price only if it is at most 2 seconds old, and never while a loss run is open.
  • The listing price may be up to 120 seconds old. It pays nobody, because both sides are empty until their first fills, and each first fill comes after its own price has moved the market.

Each price must be proven within 120 seconds of its second: the proof window. A post that arrives later is refused. A ticket’s price is in one of three states:

State When What happens to the ticket
Proven Its price is stored It fills at that price, and its proof fee goes to the price’s poster
Lost Its price wasn’t proven within 120 seconds, and a later price of the pool has been proven It is refunded, less the forfeit: its proof fee and 2% of its principal, to the burn
Pending Its price wasn’t proven, and nothing later has been proven either It waits. If the market goes 7 days without a price for it, the market freezes, and no forfeit applies

A price becomes lost only once a later price of the pool has been proven. A ticket still waiting 7 days after it was placed freezes the market with no forfeit even if its price was lost in the meantime, so the outcome after a week never depends on whether someone posted a price or poked first.

Lost prices chain into loss runs, so that prices that keep going unproven end in a freeze that lets everyone out:

  • Chaining. Each loss counts at the moment a call settles its ticket. A loss at most 6 hours after the previous one joins its run. A loss more than 6 hours after the previous one starts a new run at that moment, so isolated losses never chain, and a loss settled late never counts the time before it. A run is open while its latest loss is at most 6 hours old.
  • The freeze. A loss settled 7 days or more after its run began makes the market’s freeze due. That takes losses at most 6 hours apart across 7 days, at least 29 of them.
  • Before it freezes, every ticket placed up to that moment is settled on its own price. If its price is proven, it fills at it. If its price was lost, it is refunded minus the forfeit. If its price can still be proven, the market waits for it, at most about 120 seconds while proofs are being posted. A ticket whose price can no longer be proven waits, like any other, until any later price is proven, and is then refunded minus the forfeit, unless it has waited 7 days: then the market freezes with no forfeit.
  • After that moment, tickets don’t extend the wait. Mints placed after it are refunded with their proof fee, and redemptions settle at the frozen NAV with their proof fee returned.
  • The frozen NAV is the last of those tickets’ prices to apply.

The frozen NAV can be as old as the run. While a run is open, idle prices don’t apply, so that NAV is a ticket’s own price or a price applied before the run began. Freezing for good is described on Refunds.

Anyone. A post needs no permission, a proof can be fetched from any Elysium node that serves eth_getProof, and posting the same second twice does nothing.

  • Sagitta’s prover posts every ticket’s price as soon as its second ends (see Keepers).
  • Anyone else can post for the proof fee, 0.00024 HYPE by default, which each ticket pays to whoever posts the price that fills it.

A forfeit paid because Sagitta’s own prover missed a price is refunded under the make-whole policy.