Integrate Relatick liquidity
For aggregators and solvers
Integration Overview
Connect Relatick liquidity in an aggregator, solver or trading application.
Integrate through the Relatick API or directly through its contracts.
Option 1: API integration (recommended)
Use the Relatick API for pool metadata, quotes, depth and routes. Quote and route endpoints are public; a Trading API key raises their rate limits. See Via API.
Option 2: smart contract or SDK integration
Call Relatick's contracts directly: quote offchain with MetricOmmSwapQuoter (via eth_call), then swap through the router or the pool. A contract cannot get a live quote from inside a transaction for a pool priced by Chainlink or Pyth. See Via smart contracts.
On Ethereum, pools priced by just-in-time market-maker updates can have an old price at the latest block. To quote them from the latest state, apply the latest update from Titan's propAMM streams to your simulation. See Via Titan propAMM streams.
Compressed oracle feeds have public reads. Chainlink and Pyth reads are restricted to registered pools during swaps, approved integrators, and offchain eth_calls made without a from address. See Oracles.
Executing a swap
Before routing, read pool metadata and route only to pools whose priceProviderStatus is healthy and whose pauseLevel is 0. Route legs return the no-limit priceLimitX64, so set your own protection: amountOutMinimum for exact input, amountInMaximum for exact output.
A successful quote does not guarantee execution. Before sending, simulate the actual transaction with your real from address.
Why a swap reverts
PriceProviderFailed(reason), where reason holds the provider's error (e.g. FeedStalled()). Quote: the provider's error itself, unwrapped.priceProviderStatus is not healthyPriceProviderFailed(reason), where reason holds the oracle's NotRegistered(feedId, pool)fromBidAskRefAsymmetryOutOfBounds, BidGreaterThanAsk, ReferencePriceOutOfRange, BidIsZeroPoolPausedpauseLevel above 0. A Live quote reverts with the quoter's PoolPaused(pool, pauseLevel), unwrappedOracleStopLossTriggered(binIdx, isToken0Relatick, currentRelatick, threshold)PriceVelocityExceeded(actualDeltaSqE36, allowedDeltaSqE36)NotAllowedToSwapsender (the router, for router swaps)sender, recipient and extensionDataInvalidPool (router)/metadataInsufficientOutput, InputTooHighInvalidOutputAmountInvalidInputAmountAtHop, InvalidOutputAmountAtHopTransactionExpiredFinalAmountIsZeroIncorrectDeltaIn a quote, "wrapped" means the quoter reverts WrappedError(pool, selector, reason); decode reason for the error in the table.
On a swap, extension errors reach you unwrapped: the pool re-throws the extension's revert data unchanged.
Last updated 29 days ago
Relatick