How Quay works
Every quote submitted through the relay is cryptographically verifiable. MMs don't need to trust the relay — they can independently prove that every quote was included, unmodified, and in order.
Merkle commitment chain
Each batch of quotes is hashed into a Merkle tree. The root is committed on-chain with every relay transaction. MMs keep their own copy of submitted quotes and can reconstruct the tree to verify inclusion.
Inclusion proof
For any quote, the MM can request a Merkle proof — a short path of sibling hashes from the leaf to the root. Verifying the proof against the on-chain root confirms the quote was included in that batch, unmodified.
Ordering & freshness
Each batch carries a monotonic sequence number and timestamp. The relay signs every batch before submission. Gaps in the sequence prove skipped batches; stale timestamps prove delayed submission. Both are detectable by any MM.
TEE attestation
The relay runs inside a Trusted Execution Environment. The binary is open-source with reproducible builds. Remote attestation lets anyone verify the exact code running inside the enclave matches the public repo — no hidden logic, no quote manipulation.
The pricing engine runs on-chain and computes executable prices for every taker request. It reads each MM's quotes and settings, then applies size-dependent and inventory-aware adjustments to produce a final bid/ask.
Inputs
Price curve
Each MM defines a price curve that widens spread as trade size increases. The curve is parameterized by the MM and stored in their MM Account. Small trades get near-mid pricing; large trades pay progressively more — protecting the MM from adverse selection while keeping small flow competitive.
Inventory skew
When a MM accumulates directional inventory, the engine automatically skews quotes to incentivize rebalancing flow. Long inventory → lower asks to attract sellers. Short inventory → higher bids to attract buyers. Skew magnitude is configurable per MM.
Best execution
For each taker request, the engine evaluates all active MMs and selects the best executable price at the requested size. Multiple MMs can fill a single order if splitting improves the price. The taker always gets the best available rate.
One shared pool backs all MMs and all pairs. Capital efficiency far exceeds isolated pools.