Via smart contracts
1. Find pools
Read pool, token and quoter addresses from the metadata endpoint. Contract addresses are on Contract addresses.
2. Quote
Call MetricOmmSwapQuoter with eth_call, never as a transaction, and leave from empty. See Get quote. On Ethereum, a Live quote reads the last update already onchain, which lags; see Freshness and ordering.
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.
3. Swap
Use the router's exactInput* / exactOutput* entrypoints, or call swap on the pool 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.
Last updated 29 days ago
Relatick