Expand description
eth-prices is a pricing library & routing engine for EVM assets.
This crate currently exposes protocol-specific quoters that can read a rate at a specific block height.
§Overview
Here is a simple example showing off some of the features of eth-prices:
ⓘ
use eth_prices::{quoter::Quoter, token::Token};
use alloy::primitives::address;
let quoter = UniswapV3Quoter::from_pool(address!());Today, the main building blocks are:
quoter::Quoterfor single-hop quote sources.quoter::QuoterInstancefor storing heterogeneous quote sources together.token::TokenIdentifierfor identifying ERC-20, fiat, and native assets.token::Tokenfor token metadata and amount formatting helpers.
§Quoters
Currently supported quoters include:
quoter::fixedfor static conversion rates.quoter::uniswap_v2for Uniswap v2 pairs.quoter::uniswap_v3for Uniswap v3 pools.quoter::erc4626for ERC-4626 vaults.
§Routing
Routing is currently in-progress and will be available in a future release.
§Examples
You can find more examples in the examples directory.
Re-exports§
pub use error::EthPricesError;pub use error::Result;