> For the complete documentation index, see [llms.txt](https://docs.metric.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metric.xyz/integrate/integrate-metric-liquidity/via-smart-contracts.md).

# Via smart contracts

## 1. Find pools

Read pool, token and quoter addresses from the [metadata endpoint](/reference/api/metadata.md). Contract addresses are on [Deployments](/reference/supported-chains-and-deployments.md).

## 2. Quote

Call `MetricOmmSwapQuoter` with `eth_call`, never as a transaction, and leave `from` empty. See [Get quote](/reference/smart-contracts/get-quote.md). On Ethereum, a Live quote reads the last update already onchain, which lags; see [Freshness and ordering](/how-pools-work/freshness-and-ordering.md#for-integrators).

To price a pool from a contract, don't call the quoter or the Price Provider: restricted providers refuse both outside a swap. Call `swap` instead and check the amounts in your callback; see [Check before you pay](/reference/smart-contracts/swapping-directly-via-pool.md#check-before-you-pay).

## 3. Swap

Use the [router](/reference/smart-contracts/swapping-via-router.md)'s `exactInput*` / `exactOutput*` entrypoints, or call [`swap` on the pool](/reference/smart-contracts/swapping-directly-via-pool.md) from a contract that implements the swap callback. Set `amountOutMinimum` or `amountInMaximum`, and a deadline.

## 4. Submit

On Ethereum, where to send the transaction matters; see [Freshness and ordering](/how-pools-work/freshness-and-ordering.md#for-integrators).
