Ethereum
{% hint style="info" %} Oracle and contract addresses: see Contract addresses. {% endhint %}
Update-independent pools
If your pool doesn't need constant oracle updates, nothing special is required: follow Best practices.
Update-dependent pools
Conditional updates protocol
On Ethereum, Relatick supports conditional updates to cut gas costs. You don't push to a schedule. You sign a quote-update transaction and Relatick streams it to partner block builders. A builder includes it only in a block that contains a trade against your pool, placed ahead of that trade. If nobody trades, the update doesn't land and costs no gas. See Freshness and ordering for what that covers and what it doesn't.
Relatick integrates with Titan, Quasar, BuilderNet (Flashbots), Bombora, Eureka, BTCS and ETHGas for the conditional updates protocol. Delivery to each builder depends on its configured endpoints and credentials; an acknowledgement does not guarantee inclusion.
Always push your updates to Relatick's endpoint, even if you also push to builders directly. Relatick's infrastructure needs the updates for three things:
- Live prices in the UI. Between trades, your feed looks stale onchain. Relatick applies each update to its own simulated copy of Ethereum's latest block, so your pool shows a live price.
- Fair aggregator quotes. Aggregators and solvers price your pool from Relatick's quote endpoint, which reads that same simulated state. Without your updates they quote your pool at a stale price, or not at all.
- Price history. When your onchain feed has no valid price, Relatick records the price from your latest update instead, so your pool's chart has fewer gaps.
Pushing directly to builders is optional. Relatick forwards the updates it receives to each builder, but doesn't guarantee delivery. The response tells you which builders acknowledged it in time. A direct connection can still cut latency if you update very often. If you do push directly, still push to Relatick too.
{% hint style="info" %} Send the same update to Relatick and to the builders: the same signed transaction, with the same replacementUuid and replacementSeqNumber. If they differ, Relatick shows and quotes one price while the builder includes another. Takers then get quoted a price your pool won't fill, and later updates may be ordered wrongly. {% endhint %}
Timestamps and the staleness bound
Relatick quotes your pool against the block being built: the latest block's state plus your streamed updates, with block.timestamp set to the latest block's timestamp plus 12 seconds. An Ethereum block's timestamp is the start time of its slot, and slots are 12 seconds apart, so this is the timestamp the next block will carry. Your Price Provider measures the update's age against the timestamp of the block it runs in, never against the wall clock. If the update lands in a later block, or a slot is missed, that timestamp is 12 or more seconds later still.
- Timestamp each update for the block it targets. Use the latest block's timestamp plus 12 seconds, not the current time. A timestamp ahead of the target block is rejected.
- Resend after every new block. Relatick's simulated state resets on each new block, so your pool has no live price until your next update arrives.
- A wall-clock timestamp with a bound under 12 seconds makes your pool flicker. When a new block arrives, the target timestamp jumps 12 seconds ahead, so an update timestamped "now" is already older than the bound. The pool reads
feed_downfrom the new block until12 − boundseconds into the slot, every slot. With a 5-second bound it stays down until 7 seconds into the slot. An update signed in that window is also stale in the block it lands in, so the trade it rides with reverts. - Widen the bound past one block only with care. A wider bound also stops the flicker, but at a cost. A bound above 12 seconds keeps an update valid in blocks after the one it landed in. A trade in a block with no ordering commitment is then priced from that stored update instead of a fresh one, and takers send those trades when the price has moved in their favour. This is worse on Ethereum than on any other chain: each extra block is 12 more seconds of price movement, and no scheduled push overwrites the old price, because updates land only with trades.
An off-the-shelf Price Provider's bound can't be changed after deployment, so decide how you timestamp before you create the provider.
Oracles
Relatick supports these oracles for conditional updates:
For propAMMs, Relatick recommends:
- 1.Compressed Oracle: Relatick's custom oracle, built for propAMMs: up to 4 feeds in one slot update, about 8,000 gas per feed. Use it when your pools live on Relatick and gas per update is what you optimize for.
- 2.PUR (Priority Update Registry) by Flashbots: the shared, venue-neutral registry for priority updates, maintained by Flashbots. Both options are first-class for conditional updates; the trade-off is gas per feed, where the Compressed Oracle is cheaper. Flashbots redeploys PUR from time to time, so take the current address from the PUR repository.
Public oracles:
Chainlink and Pyth: required for APPs; also useful for sanity checks.
For Anchored Price Providers, Relatick recommends streaming the anchoring feed and your additional updates together, from the same address. Your two most recent updates should correctly serve one trade.
Relatick endpoint
Submit each signed update with POST https://api.metric.xyz/public/v1/evm/1/pamm-quote. No API key is required; requests without one are rate-limited per IP, and a trading API key raises the limit. With every update, always include as much information as you can: quoteAddress, poolAddresses and assetPairs. quoteAddress is the oracle contract your update writes to (normally the transaction's to), not the pool; put the pool in poolAddresses. Builders use it to match the quote to a trade, and a quote they can't match is never included. A builder may not use every field, but the more you send, the more likely your quote is to be included. Request and response formats: PropAMM quote.
Builder endpoints and documentation
The builders use the same protocol: a WebSocket stream of protobuf messages, with an API key you get from each builder.
wss://{eu,us,ap}.rpc.titanbuilder.xyz/ws/sendquoteupdatewss://rpc.quasar.win/ws/sendquoteupdatewss://rpc.buildernet.org/ws/sendquoteupdatewss://direct-tyo-1.bombora.build/ws/sendquoteupdatewss://{us,eu,ap,ap-2}.propamm.rpc.ethgas.com/ws/sendquoteupdateBTCS uses US and EU quote endpoints. Relatick submits directly to both and disables BTCS cross-region sharing, regardless of the request flag. Its pool-address list is optional because it also uses event-join matching; send complete quote metadata for compatibility with the other builders.
ETHGas uses four regional clusters: US East, EU Central and two in Tokyo. Relatick submits directly to all four and disables ETHGas cross-region sharing, regardless of the request flag. ETHGas evicts a quote that has not been updated for 400ms and recommends requoting about every 50ms, even when the price has not moved; slower makers lose ETHGas coverage between updates.
Last updated 29 days ago
Relatick